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

Websocket doesn't work when using version parameter #1757

Closed
danieldaeschle opened this issue Jan 5, 2020 · 9 comments · Fixed by #1760
Closed

Websocket doesn't work when using version parameter #1757

danieldaeschle opened this issue Jan 5, 2020 · 9 comments · Fixed by #1760
Assignees
Labels

Comments

@danieldaeschle
Copy link

Describe the bug
When defining a websocket handler using version=1 a exceptions will be thrown.

Code snippet
Relevant source code, make sure to remove what is not necessary.

@app.websocket("/changes", version=1)

Expected behavior
It should work like without version=1

Environment (please complete the following information):

  • OS: Fedora 31
  • Sanic: 19.12.2
@danieldaeschle
Copy link
Author

I found out, that the websocket path is still /changes without /v1 as prefix.
It's a routing issue.

@danieldaeschle
Copy link
Author

@ahopkins
Copy link
Member

ahopkins commented Jan 6, 2020

@danieldaeschle Would you be able to submit a PR and perhaps a unit test?

@danieldaeschle
Copy link
Author

danieldaeschle commented Jan 6, 2020 via email

@ahopkins
Copy link
Member

ahopkins commented Jan 7, 2020

I did a quick look at the code you linked to on my phone. I'm fairly certain that you pinpointed the right place. All you should need to do is add the version kwarg to the method and then to the call that you linked. If you want to just do that much I can then take a look and give you some more direction on where and how to add the test.

@danieldaeschle
Copy link
Author

danieldaeschle commented Jan 7, 2020 via email

@ahopkins
Copy link
Member

ahopkins commented Jan 7, 2020

OK. Thanks for taking a shot. I can take this one in conjunction with upgrading websockets dependency.

@ahopkins ahopkins self-assigned this Jan 7, 2020
@danieldaeschle
Copy link
Author

danieldaeschle commented Jan 7, 2020 via email

@stale
Copy link

stale bot commented Apr 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions.

@stale stale bot added the stale label Apr 6, 2020
@stale stale bot closed this as completed May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants