From d14d967b5f384f7e66db46ac4511c73154167c39 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Thu, 5 Dec 2024 13:11:43 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/container/index.ts | 2 +- packages/astro/src/core/app/index.ts | 10 +++++----- packages/astro/src/core/build/generate.ts | 2 +- packages/astro/src/core/render-context.ts | 4 ++-- packages/astro/src/vite-plugin-astro-server/route.ts | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/astro/src/container/index.ts b/packages/astro/src/container/index.ts index c762773d3b..9ca9d23001 100644 --- a/packages/astro/src/container/index.ts +++ b/packages/astro/src/container/index.ts @@ -508,7 +508,7 @@ export class experimental_AstroContainer { pathname: url.pathname, locals: options?.locals ?? {}, partial: options?.partial ?? true, - clientAddress: '' + clientAddress: '', }); if (options.params) { renderContext.params = options.params; diff --git a/packages/astro/src/core/app/index.ts b/packages/astro/src/core/app/index.ts index da5f917c1f..0e776ae9f2 100644 --- a/packages/astro/src/core/app/index.ts +++ b/packages/astro/src/core/app/index.ts @@ -241,7 +241,7 @@ export class App { let addCookieHeader: boolean | undefined; addCookieHeader = renderOptions?.addCookieHeader; - clientAddress = renderOptions?.clientAddress ?? Reflect.get(request,clientAddressSymbol); + clientAddress = renderOptions?.clientAddress ?? Reflect.get(request, clientAddressSymbol); routeData = renderOptions?.routeData; locals = renderOptions?.locals; @@ -286,7 +286,7 @@ export class App { request, routeData, status: defaultStatus, - clientAddress + clientAddress, }); response = await renderContext.render(await mod.page()); } catch (err: any) { @@ -305,7 +305,7 @@ export class App { // We don't have an error to report here. Passing null means we pass nothing intentionally // while undefined means there's no error error: response.status === 500 ? null : undefined, - clientAddress + clientAddress, }); } @@ -387,7 +387,7 @@ export class App { routeData: errorRouteData, status, props: { error }, - clientAddress + clientAddress, }); const response = await renderContext.render(await mod.page()); return this.#mergeResponses(response, originalResponse); @@ -399,7 +399,7 @@ export class App { status, response: originalResponse, skipMiddleware: true, - clientAddress + clientAddress, }); } } diff --git a/packages/astro/src/core/build/generate.ts b/packages/astro/src/core/build/generate.ts index 6fe6351cb6..47d6ef3def 100644 --- a/packages/astro/src/core/build/generate.ts +++ b/packages/astro/src/core/build/generate.ts @@ -444,7 +444,7 @@ async function generatePath( pathname: pathname, request, routeData: route, - clientAddress: undefined + clientAddress: undefined, }); let body: string | Uint8Array; diff --git a/packages/astro/src/core/render-context.ts b/packages/astro/src/core/render-context.ts index 614777ac5f..86e39ee9a3 100644 --- a/packages/astro/src/core/render-context.ts +++ b/packages/astro/src/core/render-context.ts @@ -525,11 +525,11 @@ export class RenderContext { getClientAddress() { const { pipeline, request, routeData, clientAddress } = this; - if(routeData.prerender) { + if (routeData.prerender) { throw new AstroError(AstroErrorData.PrerenderClientAddressNotAvailable); } - if(clientAddress) { + if (clientAddress) { return clientAddress; } diff --git a/packages/astro/src/vite-plugin-astro-server/route.ts b/packages/astro/src/vite-plugin-astro-server/route.ts index 3498571e87..a3a5bc93cc 100644 --- a/packages/astro/src/vite-plugin-astro-server/route.ts +++ b/packages/astro/src/vite-plugin-astro-server/route.ts @@ -190,7 +190,7 @@ export async function handleRoute({ middleware: isDefaultPrerendered404(matchedRoute.route) ? undefined : middleware, request, routeData: route, - clientAddress: incomingRequest.socket.remoteAddress + clientAddress: incomingRequest.socket.remoteAddress, }); let response; @@ -248,7 +248,7 @@ export async function handleRoute({ middleware: isDefaultPrerendered404(fourOhFourRoute.route) ? undefined : middleware, request, routeData: fourOhFourRoute.route, - clientAddress: incomingRequest.socket.remoteAddress + clientAddress: incomingRequest.socket.remoteAddress, }); response = await renderContext.render(fourOhFourRoute.preloadedComponent); }