[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 { Context } from '@netlify/edge-functions';
|
||||||
|
import type { SSRManifest } from 'astro';
|
||||||
import { App } from 'astro/app';
|
import { App } from 'astro/app';
|
||||||
|
|
||||||
const clientAddressSymbol = Symbol.for('astro.clientAddress');
|
const clientAddressSymbol = Symbol.for('astro.clientAddress');
|
||||||
|
@ -16,9 +16,10 @@ export function createExports(manifest: SSRManifest) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (app.match(request)) {
|
if (app.match(request)) {
|
||||||
const ip = request.headers.get('x-nf-client-connection-ip')
|
const ip =
|
||||||
|| context?.ip
|
request.headers.get('x-nf-client-connection-ip') ||
|
||||||
|| (context as any)?.remoteAddr?.hostname;
|
context?.ip ||
|
||||||
|
(context as any)?.remoteAddr?.hostname;
|
||||||
Reflect.set(request, clientAddressSymbol, ip);
|
Reflect.set(request, clientAddressSymbol, ip);
|
||||||
const response = await app.render(request);
|
const response = await app.render(request);
|
||||||
if (app.setCookieHeaders) {
|
if (app.setCookieHeaders) {
|
||||||
|
|
Loading…
Reference in a new issue