Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-sull authored and github-actions[bot] committed Jun 15, 2022
1 parent 0ddcef2 commit a4c78b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions packages/integrations/netlify/src/integration-functions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AstroAdapter, AstroConfig, AstroIntegration } from 'astro';
import { createRedirects } from './shared.js';
import type { Args } from './netlify-functions.js';
import { createRedirects } from './shared.js';

export function getAdapter(args: Args = {}): AstroAdapter {
return {
Expand All @@ -16,7 +16,10 @@ interface NetlifyFunctionsOptions {
binaryMediaTypes?: string[];
}

function netlifyFunctions({ dist, binaryMediaTypes }: NetlifyFunctionsOptions = {}): AstroIntegration {
function netlifyFunctions({
dist,
binaryMediaTypes,
}: NetlifyFunctionsOptions = {}): AstroIntegration {
let _config: AstroConfig;
let entryFile: string;
return {
Expand Down
4 changes: 2 additions & 2 deletions packages/integrations/netlify/src/netlify-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ export const createExports = (manifest: SSRManifest, args: Args) => {

const response: Response = await app.render(request);
const responseHeaders = Object.fromEntries(response.headers.entries());

const responseContentType = parseContentType(responseHeaders['content-type']);
const responseIsBase64Encoded = knownBinaryMediaTypes.has(responseContentType);

const responseBody = responseIsBase64Encoded
? Buffer.from(await response.text(), 'binary').toString('base64')
: await response.text();

const fnResponse: any = {
statusCode: response.status,
headers: responseHeaders,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Base64 Responses', () => {
},
adapter: netlifyAdapter({
dist: new URL('./fixtures/base64-response/dist/', import.meta.url),
binaryMediaTypes: ['font/otf']
binaryMediaTypes: ['font/otf'],
}),
site: `http://example.com`,
integrations: [testIntegration()],
Expand Down

0 comments on commit a4c78b5

Please sign in to comment.