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

When forwarding all headers , websocket subscriptions break #1149

Closed
warrenisarobot opened this issue Sep 5, 2024 · 6 comments
Closed

When forwarding all headers , websocket subscriptions break #1149

warrenisarobot opened this issue Sep 5, 2024 · 6 comments
Assignees
Labels
bug Something isn't working internally-reviewed The issue has been reviewed internally.

Comments

@warrenisarobot
Copy link

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.

@warrenisarobot warrenisarobot added the bug Something isn't working label Sep 5, 2024
Copy link

github-actions bot commented Sep 5, 2024

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.

@Aenimus
Copy link
Member

Aenimus commented Sep 6, 2024

Hi @warrenisarobot

Please do the following:

  1. Delete all Cosmo-related containers, images, and volumes.
  2. Reset any and all changes that you might have made in the repository (if any).
  3. Re-pull the repository.
  4. Ensure docker --version yields at least 23.
  5. Try make full-demo-up again.

After you have completed these steps, please do let us know whether you were successful or the problem persists.

Thank you!

The WunderGraph Team

@Aenimus
Copy link
Member

Aenimus commented Sep 6, 2024

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.

@warrenisarobot
Copy link
Author

warrenisarobot commented Sep 9, 2024

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.

@AndreasZeissner AndreasZeissner added the internally-reviewed The issue has been reviewed internally. label Sep 10, 2024
@StarpTech
Copy link
Contributor

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.

@StarpTech
Copy link
Contributor

Hi everyone. The issue has been addressed in #1293. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internally-reviewed The issue has been reviewed internally.
Projects
None yet
Development

No branches or pull requests

4 participants