Skip to content

Commit

Permalink
feat: add client ip header to edge func local dev (#4681)
Browse files Browse the repository at this point in the history
* feat: add client ip header to edge func local dev

* chore: update contributors field

* chore: update contributors field

* fix: replace localhost with constant

* chore: update contributors field

* chore: update contributors field

* chore: update contributors field

* chore: update contributors field

Co-authored-by: JWhist <JWhist@users.noreply.github.com>
Co-authored-by: token-generator-app[bot] <token-generator-app[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 8, 2022
1 parent 3bfbe87 commit 39d8050
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/edge-functions/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ module.exports = {
Geo: 'x-nf-geo',
Passthrough: 'x-deno-pass',
RequestID: 'X-NF-Request-ID',
IP: 'x-nf-client-connection-ip',
}
1 change: 1 addition & 0 deletions src/lib/edge-functions/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const initializeProxy = async ({
[headers.ForwardedHost]: `localhost:${mainPort}`,
[headers.Passthrough]: 'passthrough',
[headers.RequestID]: generateUUID(),
[headers.IP]: LOCAL_HOST,
}

if (settings.https) {
Expand Down

1 comment on commit 39d8050

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 294 MB

Please sign in to comment.