0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

[ci] format

This commit is contained in:
Matthew Phillips 2024-12-05 13:11:43 +00:00 committed by astrobot-houston
parent 306c9f9a9a
commit d14d967b5f
5 changed files with 11 additions and 11 deletions

View file

@ -508,7 +508,7 @@ export class experimental_AstroContainer {
pathname: url.pathname, pathname: url.pathname,
locals: options?.locals ?? {}, locals: options?.locals ?? {},
partial: options?.partial ?? true, partial: options?.partial ?? true,
clientAddress: '' clientAddress: '',
}); });
if (options.params) { if (options.params) {
renderContext.params = options.params; renderContext.params = options.params;

View file

@ -241,7 +241,7 @@ export class App {
let addCookieHeader: boolean | undefined; let addCookieHeader: boolean | undefined;
addCookieHeader = renderOptions?.addCookieHeader; addCookieHeader = renderOptions?.addCookieHeader;
clientAddress = renderOptions?.clientAddress ?? Reflect.get(request,clientAddressSymbol); clientAddress = renderOptions?.clientAddress ?? Reflect.get(request, clientAddressSymbol);
routeData = renderOptions?.routeData; routeData = renderOptions?.routeData;
locals = renderOptions?.locals; locals = renderOptions?.locals;
@ -286,7 +286,7 @@ export class App {
request, request,
routeData, routeData,
status: defaultStatus, status: defaultStatus,
clientAddress clientAddress,
}); });
response = await renderContext.render(await mod.page()); response = await renderContext.render(await mod.page());
} catch (err: any) { } 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 // We don't have an error to report here. Passing null means we pass nothing intentionally
// while undefined means there's no error // while undefined means there's no error
error: response.status === 500 ? null : undefined, error: response.status === 500 ? null : undefined,
clientAddress clientAddress,
}); });
} }
@ -387,7 +387,7 @@ export class App {
routeData: errorRouteData, routeData: errorRouteData,
status, status,
props: { error }, props: { error },
clientAddress clientAddress,
}); });
const response = await renderContext.render(await mod.page()); const response = await renderContext.render(await mod.page());
return this.#mergeResponses(response, originalResponse); return this.#mergeResponses(response, originalResponse);
@ -399,7 +399,7 @@ export class App {
status, status,
response: originalResponse, response: originalResponse,
skipMiddleware: true, skipMiddleware: true,
clientAddress clientAddress,
}); });
} }
} }

View file

@ -444,7 +444,7 @@ async function generatePath(
pathname: pathname, pathname: pathname,
request, request,
routeData: route, routeData: route,
clientAddress: undefined clientAddress: undefined,
}); });
let body: string | Uint8Array; let body: string | Uint8Array;

View file

@ -525,11 +525,11 @@ export class RenderContext {
getClientAddress() { getClientAddress() {
const { pipeline, request, routeData, clientAddress } = this; const { pipeline, request, routeData, clientAddress } = this;
if(routeData.prerender) { if (routeData.prerender) {
throw new AstroError(AstroErrorData.PrerenderClientAddressNotAvailable); throw new AstroError(AstroErrorData.PrerenderClientAddressNotAvailable);
} }
if(clientAddress) { if (clientAddress) {
return clientAddress; return clientAddress;
} }

View file

@ -190,7 +190,7 @@ export async function handleRoute({
middleware: isDefaultPrerendered404(matchedRoute.route) ? undefined : middleware, middleware: isDefaultPrerendered404(matchedRoute.route) ? undefined : middleware,
request, request,
routeData: route, routeData: route,
clientAddress: incomingRequest.socket.remoteAddress clientAddress: incomingRequest.socket.remoteAddress,
}); });
let response; let response;
@ -248,7 +248,7 @@ export async function handleRoute({
middleware: isDefaultPrerendered404(fourOhFourRoute.route) ? undefined : middleware, middleware: isDefaultPrerendered404(fourOhFourRoute.route) ? undefined : middleware,
request, request,
routeData: fourOhFourRoute.route, routeData: fourOhFourRoute.route,
clientAddress: incomingRequest.socket.remoteAddress clientAddress: incomingRequest.socket.remoteAddress,
}); });
response = await renderContext.render(fourOhFourRoute.preloadedComponent); response = await renderContext.render(fourOhFourRoute.preloadedComponent);
} }