Support standard Forwarded
header in Node adapter output
#11148
Labels
feature request
New feature or request
p2-nice-to-have
SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
pkg:adapter-node
Describe the problem
I've recently learned about the existence of the
Forwarded
header, which is a standard I'd never heard of before, but it apparently replaces the several otherX-Forwaded-*
headers that have been de facto standards for a while. The Node adapter does not support pulling its protocol, host, and client IP address information from this header.Describe the proposed solution
This should be something that the user should be able to opt in to via runtime environment variables passed to the built Node application. Determining the API here is probably going to be half the battle.
We should probably have this work in the same "count from the right" way that the
X-Forwarded-For
header does. At that point, we can take thefor
,host
, andproto
values from that segment of the header. I don't know what we should do if the header appears to be malformed. Is that an instant 500 before the request even reaches the rest of the app?I don't know whether we want to allow
Forwarded
to be used simultaneously with the otherPROTOCOL_HEADER
,HOST_HEADER
,ADDRESS_HEADER
env vars. Probably not?I don't know how we want parsing the
Forwarded
header to be enabled. A singleFORWARDED_DEPTH
env var maybe? Since it's a standard, I don't know how valuable it is to allow people to use a different header name.Alternatives considered
No response
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: