Conversation
| xForwardedFor = http.CanonicalHeaderKey("X-Forwarded-For") | ||
| xRealIP = http.CanonicalHeaderKey("X-Real-IP") | ||
| xForwardedProto = http.CanonicalHeaderKey("X-Forwarded-Scheme") | ||
| xForwardedHost = http.CanonicalHeaderKey("X-Forwarded-Host") |
There was a problem hiding this comment.
We may also want to extend the RFC7239 header Forwarded to parse the host as well: https://tools.ietf.org/html/rfc7239#section-7.5
7.5. Example Usage
A request from a client with IP address 192.0.2.43 passes through a
proxy with IP address 198.51.100.17, then through another proxy with
IP address 203.0.113.60 before reaching an origin server. This
could, for example, be an office client behind a corporate malware
filter talking to a origin server through a reverse proxy.o The HTTP request between the client and the first proxy has no
"Forwarded" header field.o The HTTP request between the first and second proxy has a
"Forwarded: for=192.0.2.43" header field.o The HTTP request between the second proxy and the origin server
has a "Forwarded: for=192.0.2.43,
for=198.51.100.17;by=203.0.113.60;proto=http;host=example.com"
header field.
|
I don't know how I missed this! Thanks @themihai |
fixes #74