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

skip websocket auth init if initialized #126

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

avalanche123
Copy link
Collaborator

Description of your changes

During websocket initialization we overwrote auth context populated from the
request middleware. This is necessary when using the playground as browsers
send only a limited subset of headers when initializing a websocket connection.
However, for programmatic websocket clients that do send auth headers in the
initial upgrade request, the websocket init function was clearing those from
context.

This PR makes auth context initialization from the websocket connection init
function conditional and only runs if auth context wasn't already initialized.

I have:

  • Read and followed Upbound's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, as appropriate.

How has this code been tested

I'm testing this locally with a programmatic websocket client.

Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Copy link

@darkmuggle darkmuggle left a comment

Choose a reason for hiding this comment

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

That's a lot of ||'s

LGTM

@avalanche123 avalanche123 merged commit b9fde41 into upbound:main Sep 20, 2023
8 checks passed
@avalanche123 avalanche123 deleted the fix-websocket-init branch September 20, 2023 14:45
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

Successfully merging this pull request may close these issues.

2 participants