Skip to content

Commit 31fbb1c

Browse files
authored
feat: get client IP from Context object rather than the request header (#5473)
* feat: get client IP from Context object rather than header * chore: add changeset entry for change
1 parent f737122 commit 31fbb1c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: .changeset/yellow-laws-prove.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-netlify': minor
3+
---
4+
5+
feat: get client IP from Context object rather than the request header

Diff for: packages/adapter-netlify/src/edge.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function handler(request, context) {
1919
return server.respond(request, {
2020
platform: { context },
2121
getClientAddress() {
22-
return request.headers.get('x-nf-client-connection-ip');
22+
return context.ip;
2323
}
2424
});
2525
}

0 commit comments

Comments
 (0)