cosmo
cosmo copied to clipboard
When forwarding all headers , websocket subscriptions break
Component(s)
router
Component version
0.106.0
wgc version
0.63.1
controlplane version
0.106.0
router version
0.106.0
What happened?
Edit the router config to forward all headers.
Use the cosmo demo with make full-demo-up
Websocket subscriptions return an "Internal server error"
Environment information
Environment
OS: (e.g., "MacOS Sonoma 14.6") Package Manager: npm
Router configuration
headers:
all:
request:
- op: "propagate"
matching: .*
Router execution config
No response
Log output
No response
Additional context
When forwarding specific headers like "Authorization" this works correctly, but when using a wildcard it fails. In this specific setup there is an ingress controller ahead that is passing along only relevant headers which are then passed along to the subgraphs.
WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible. The roadmap is driven by our customers and we have to prioritize issues that are important to them. You can influence the priority by becoming a customer. Please contact us here.
Hi @warrenisarobot
Please do the following:
- Delete all Cosmo-related containers, images, and volumes.
- Reset any and all changes that you might have made in the repository (if any).
- Re-pull the repository.
- Ensure
docker --versionyields at least 23. - Try
make full-demo-upagain.
After you have completed these steps, please do let us know whether you were successful or the problem persists.
Thank you!
The WunderGraph Team
I just read that you're editing config.yaml. The intention of the demo is a quick, one-button solution to show you the fundamentals of WunderGraph Cosmo and the router. Making edits and altering the demo is likely to cause issues like this.
I originally saw the issue when testing on our own subgraphs. To simplify the problem I reverted back to using the subgraphs provided by the demo. It is the same either way - when I forward all headers subscriptions via websocket do not work. I didn't see this behavior documented in the router header config section so I wanted to bring it here to see if I was missing something, or it was expected.
I have tried multiple versions of the router, and all have the same behavior. If I forward all headers then websocket subscriptions do not work.
Hi @warrenisarobot, thank you! We've tracked the issue and will provide a resolution soon. We highly discourage forwarding all headers. This will destroy the deduplication cache and is a security risk as well. If possible, please try to forward only whitelisted headers.
Hi everyone. The issue has been addressed in https://github.com/wundergraph/cosmo/pull/1293. Thanks!