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

reverse_proxy should not rewrite Sec-WebSocket-Key #3888

Closed
BenjaminBeichler opened this issue Nov 26, 2020 · 3 comments
Closed

reverse_proxy should not rewrite Sec-WebSocket-Key #3888

BenjaminBeichler opened this issue Nov 26, 2020 · 3 comments
Labels
declined 🚫 Not a fit for this project

Comments

@BenjaminBeichler
Copy link

I try to setup a reverse_proxy for GTK's broadwayd, which fails. I actually found the reason:

The Sec-WebSocket-Key header is changed at the proxy turnaround to Sec-Websocket-Key. Unfortunately, the broadwayd header parser is not standard-conform and parses the header case-sensitive. I already submitted a bug request for this: https://gitlab.gnome.org/GNOME/gtk/-/issues/3406

But I think this may also affect many web server implementations. I did not find the source code place, where this rewrite happens, but I sniffed the outgoing proxied http-request from caddy to broadwayd, where the Sec-WebSocket-Key-header is changed.

I think I found several forum posts, where this behavior could also cause problems.

@mholt
Copy link
Member

mholt commented Nov 26, 2020

Unfortunately, broadwayd is broken and will simply have to be fixed. If you want other servers to bend over in non-spec-conforming ways you'll have to take up the issue with the Go project / standard library, but they'll tell you to fix the application (and I agree).

@mholt mholt closed this as completed Nov 26, 2020
@mholt mholt added the declined 🚫 Not a fit for this project label Nov 26, 2020
@BenjaminBeichler
Copy link
Author

Thanks for the hint ... I was hoping it will be a fix in caddy, which would published much more quickly than updates at the gtk framework, but I totally understand your statement.

@BenjaminBeichler
Copy link
Author

FYI: I submitted a patch to the gtk repo https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2894 and compiled my local ubuntu version of gtk3 with this fix and now the reverse proxy is working.

Unfortunately, I don't think my merge request will be back ported to gtk3, so it will take some time to appear in upstream distributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
declined 🚫 Not a fit for this project
Projects
None yet
Development

No branches or pull requests

3 participants
@mholt @BenjaminBeichler and others