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

Fix multiple ws_connect with headers dict #1643

Merged
merged 1 commit into from
Feb 16, 2017

Conversation

emlove
Copy link
Contributor

@emlove emlove commented Feb 16, 2017

What do these changes do?

Currently in my client, I'm generating a headers dictionary that is used for all websockets connections. What I found is that when ws_connect is called, the websocket key is added to this dict, which is then passed back on the next call to ws_connect. Since the default headers don't overwrite the headers dict, the stale secret key is sent to the server, and the connection fails.

This change forces the secret key to overwrite the existing headers, since it is (and should) be regenerated for each connection. We might also want to consider copying the incoming dict before making changes, but that's another issue.

Are there changes in behavior for the user?

No

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new entry to CHANGES.rst
    • Choose any open position to avoid merge conflicts with other PRs.
    • Add a link to the issue you are fixing (if any) using #issue_number format at the end of changelog message. Use Pull Request number if there are no issues for PR or PR covers the issue only partially.

@fafhrd91
Copy link
Member

thanks!

@fafhrd91 fafhrd91 merged commit 96a760d into aio-libs:1.3 Feb 16, 2017
@emlove
Copy link
Contributor Author

emlove commented Feb 16, 2017

A little too quick! There were a few linter issues in the test that popped up.

@fafhrd91
Copy link
Member

thats fine. i'll fix

@emlove emlove deleted the ws_connect_fix branch February 16, 2017 05:50
@emlove
Copy link
Contributor Author

emlove commented Feb 16, 2017

#1644

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants