You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ForwardedRequestCustomizer uses connection port instead of proto default when host lacks port #13970
When Jetty is deployed behind a reverse proxy and listens on port 8084, this results in the request authority being interpreted as:
example.com:8084
instead of the expected:
example.com
(since the proto=https implies port 443 by default).
The relevant RFCs (RFC 7230 and RFC 9112) describe default-port behavior for URIs and authority forms, though none explicitly define it for the Forwarded header. However, other implementations such as Vert.x’s ForwardedParser resolve the missing port to the default port corresponding to the proto scheme.
Expected behavior:
When the host parameter in a Forwarded header does not include a port, Jetty should use the default port associated with the proto scheme (80 for HTTP, 443 for HTTPS), rather than the local connection port.
Actual behavior:
Jetty uses the connector’s local port (e.g., 8084), resulting in an incorrect authority.
Environment:
Jetty version 12.1.3
Notes:
This behavior causes incorrect redirects and absolute URL reconstruction behind reverse proxies when relying on Forwarded headers.
Activity
joakime commentedon Nov 4, 2025
What is your
HttpConfiguration.getSecurePort()set to on the connector that handles that request?zenios commentedon Nov 4, 2025
I dont set that since.I only listen to 8084 unsecured behind nginx and nginx is the one that does the ssl termination and forward to jetty
Merge pull request #15381 from zenios/fix/jetty-12.1.x/13970-forwarde…
Fixes jetty#13970 - ForwardedRequestCustomizer must not use the reque…
[SPARK-59647][BUILD] Upgrade Jetty to 12.1.13