-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
X-Forwarded-Host
doesn't support setting a port
#2191
Comments
An example use case:
|
I agree that could be useful. The header class is currently still marked (I don't quite understand the need for that header, why would a reverse proxy rewrite the |
@jrudolph this is discussed by the HTTP spec in RFC 7230
But I think in this spec, "proxy" always refers to a forward client-side proxy, so it's a bit ambiguous about the case of a reverse proxy. It looks like implementations vary in practice, with some preserving the original I'm not sure where the
Anyway, it seems like maybe for a non-standard header, it should be lax about what's allowed as the value. |
The way I understood those X-Forwarded-* headers is the following: My interpretation is, |
The problem with de-facto headers is that you are free to pick and choose. MDN doesn't acknowledge the existence of a I think @TimMoore's suggestion is the best path forward:
|
Yes, I think we could be lax with what's in that header |
According to the
Forwarded
spec:Then, Mozilla's MDN documents the
X-Forwarded-Host
syntax ambiguously. First is states: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:which is different from the MDN spec for
Host
:The current implementation in Akka-HTTP uses the
<host>
syntax and cites the MDN page linked above (which can be interpreted in different ways).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 text was updated successfully, but these errors were encountered: