-
Notifications
You must be signed in to change notification settings - Fork 55
Description
According to the
Forwardedspec:The syntax for a "host" value, after potential quoted-string
unescaping, MUST conform to the Host ABNF described in Section 5.4 of
[RFC7230].Then, Mozilla's MDN documents the
X-Forwarded-Hostsyntax ambiguously. First is states:The X-Forwarded-Host (XFH) header is a de-facto standard header for identifying the original host requested by the client in the Host HTTP request header.
which seems to imply both
HostandX-Forwarded-Hostuse the same syntax (as specified inForwarded). But then on theSyntaxsection it's specified as:X-Forwarded-Host: <host>which is different from the MDN spec for
Host:Host: <host>:<port>
X-Forwarded-Hostis a de facto standard so we could be debating forever. Per theForwardedspec, I thinkX-Forwarded-Hostshould allow setting a port.
The above gist from Akka applies to Charon as well. The X-Forwarded-Host header set by the requestProxyHeadersRewriter currently only contains the host name. While requestProxyHeadersRewriter also sets X-Forwarded-Port, some applications expect the port in the X-Forwarded-Host header.