Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored and astrobot-houston committed Dec 5, 2024
1 parent 306c9f9 commit d14d967
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/astro/src/container/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions packages/astro/src/core/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -286,7 +286,7 @@ export class App {
request,
routeData,
status: defaultStatus,
clientAddress
clientAddress,
});
response = await renderContext.render(await mod.page());
} catch (err: any) {
Expand All @@ -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,
});
}

Expand Down Expand Up @@ -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);
Expand All @@ -399,7 +399,7 @@ export class App {
status,
response: originalResponse,
skipMiddleware: true,
clientAddress
clientAddress,
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/build/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ async function generatePath(
pathname: pathname,
request,
routeData: route,
clientAddress: undefined
clientAddress: undefined,
});

let body: string | Uint8Array;
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/src/core/render-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/astro/src/vite-plugin-astro-server/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit d14d967

Please sign in to comment.