0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

[ci] format

This commit is contained in:
matthewp 2023-04-06 19:43:15 +00:00 committed by fredkbot
parent 416ceb9730
commit e0ee7765d0

View file

@ -1,5 +1,5 @@
import type { SSRManifest } from 'astro';
import type { Context } from '@netlify/edge-functions';
import type { SSRManifest } from 'astro';
import { App } from 'astro/app';
const clientAddressSymbol = Symbol.for('astro.clientAddress');
@ -16,9 +16,10 @@ export function createExports(manifest: SSRManifest) {
return;
}
if (app.match(request)) {
const ip = request.headers.get('x-nf-client-connection-ip')
|| context?.ip
|| (context as any)?.remoteAddr?.hostname;
const ip =
request.headers.get('x-nf-client-connection-ip') ||
context?.ip ||
(context as any)?.remoteAddr?.hostname;
Reflect.set(request, clientAddressSymbol, ip);
const response = await app.render(request);
if (app.setCookieHeaders) {