Skip to content
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

Add ForwardedRequestCustomizer #3407

Merged

Conversation

devinrsmith
Copy link
Member

This allows jetty to correctly handle x-forwarded-* headers.

$ curl -H "x-forwarded-proto: https" -H "x-forwarded-host: example.com" -I http://localhost:10000
HTTP/1.1 302 Found
Date: Mon, 06 Feb 2023 02:41:34 GMT
Location: https://example.com/ide/
Content-Length: 0
Server: Jetty(11.0.13)

Without this patch, we would get Location: http://localhost:10000/ide/

This allows jetty to correctly handle x-forwarded-* headers.

```
$ curl -H "x-forwarded-proto: https" -H "x-forwarded-host: example.com" -I http://localhost:10000
HTTP/1.1 302 Found
Date: Mon, 06 Feb 2023 02:41:34 GMT
Location: https://example.com/ide/
Content-Length: 0
Server: Jetty(11.0.13)
```
@devinrsmith devinrsmith added bug Something isn't working java jetty labels Feb 6, 2023
@devinrsmith devinrsmith self-assigned this Feb 6, 2023
Copy link
Member

@niloc132 niloc132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but where do we consume these, what's the use case or handler for this?

@devinrsmith
Copy link
Member Author

I've got a couple of different reverse proxy setups - depending on if you requested the full /ide/ path, or something like /ide, you'd get a redirect and it would ship you back to http. I'm not 100% sure what the "correct" thing to do, or if there is even a definitive standard in this space. Some proxies might "fix" a misbehaving server, but other proxies might assume the "server knows best", and so proceed w/ the "bad" Location.

@devinrsmith devinrsmith merged commit 62e8113 into deephaven:main Feb 6, 2023
@devinrsmith devinrsmith deleted the jetty-forwarded-request-customizer branch February 6, 2023 16:54
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working java jetty NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants