mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
[ci] format
This commit is contained in:
parent
416ceb9730
commit
e0ee7765d0
1 changed files with 5 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue