Skip to content

Commit

Permalink
feat: get client IP from Context object rather than the request header (
Browse files Browse the repository at this point in the history
#5473)

* feat: get client IP from Context object rather than header

* chore: add changeset entry for change
  • Loading branch information
ericapisani authored Jul 12, 2022
1 parent f737122 commit 31fbb1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/yellow-laws-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-netlify': minor
---

feat: get client IP from Context object rather than the request header
2 changes: 1 addition & 1 deletion packages/adapter-netlify/src/edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
}
Expand Down

0 comments on commit 31fbb1c

Please sign in to comment.