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

grpcwebproxy --allowed_headers param is case-sensitive for WebSocket #1175

Open
dartkron opened this issue Sep 4, 2023 · 0 comments
Open

Comments

@dartkron
Copy link

dartkron commented Sep 4, 2023

Versions of relevant software used
grpcwebproxy-v0.15.0

What happened
We use WebSocket to connect browser-clients with bi-directional streaming and noticed that although some headers are listed in --allowed_headers, they were not forwarded to the server.
For example, we used to run grpcwebproxy with --allowed_headers=x-forwarded-for , but header X-Forwarded-For wasn't forwarded.

We debugged it and found that grpcwebproxy filters WebSocket headers as case-sensitive.

To confirm the issue, we've ran grpcwebproxy with --allowed_headers=x-forwarded-for,X-Forwarded-For and it started to work.

What you expected to happen
We would expect that grpcwebproxy will follow the RFC:

Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive.

Moreover, for regular HTTP headers are handled as case-insensitive: 1 -> 2 -> 3, so we would expect a consistent behavior across all protocols.

How to reproduce it (as minimally and precisely as possible):

  1. Run a simple GRPC server which print all received headers.
  2. Run grpcwebproxy which proxies requests to the server started above with --use_websockets and --allowed_headers=header_name.
  3. Connect a WebSocket client which sends header Header_Name.
  4. Verify that the header wasn't received by the server.
  5. Restart grpcwebproxy with --allowed_headers=Header_Name.
  6. Re-connect client and verify that the header has been received a this time.

Anything else we need to know
Please acknowledge the issue and we would be happy to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant