diff --git a/.changeset/yellow-laws-prove.md b/.changeset/yellow-laws-prove.md new file mode 100644 index 000000000000..02a29c6345aa --- /dev/null +++ b/.changeset/yellow-laws-prove.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-netlify': minor +--- + +feat: get client IP from Context object rather than the request header diff --git a/packages/adapter-netlify/src/edge.js b/packages/adapter-netlify/src/edge.js index 533d57eb2cc9..44692e5fd49c 100644 --- a/packages/adapter-netlify/src/edge.js +++ b/packages/adapter-netlify/src/edge.js @@ -19,7 +19,7 @@ export default function handler(request, context) { return server.respond(request, { platform: { context }, getClientAddress() { - return request.headers.get('x-nf-client-connection-ip'); + return context.ip; } }); }