-
Notifications
You must be signed in to change notification settings - Fork 55
Description
According to the
Forwarded
spec: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-Host
syntax 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
Host
andX-Forwarded-Host
use the same syntax (as specified inForwarded
). But then on theSyntax
section it's specified as:X-Forwarded-Host: <host>
which is different from the MDN spec for
Host
:Host: <host>:<port>
X-Forwarded-Host
is a de facto standard so we could be debating forever. Per theForwarded
spec, I thinkX-Forwarded-Host
should 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.