Harden Astro.clientAddress when using from Node adapter#15742
Conversation
🦋 Changeset detectedLatest commit: 8e01ece The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ematipico
left a comment
There was a problem hiding this comment.
There are some tests that need updating.
Also a bit concerned... isn't this, technically, a breaking change? But I don't have strong feelings. However, maybe we should update the docs https://docs.astro.build/en/reference/adapter-reference/#clientaddress
We should mention that clientAddress values must match values inside allowedDomains
|
@ematipico Yes breaking, but in line with the other enforcements over |
Changes
X-Forwarded-Foris now gated bysecurity.allowedDomains, consistent with howX-Forwarded-Host,X-Forwarded-Proto, andX-Forwarded-Portare already handled.Testing
Added and updated unit tests in
packages/astro/test/units/app/node.test.jsDocs
N/A, bug fix