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

No route found... Username incudes - #439

Closed
domwhewell-sage opened this issue May 17, 2024 · 1 comment
Closed

No route found... Username incudes - #439

domwhewell-sage opened this issue May 17, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@domwhewell-sage
Copy link

Describe the bug
Errors are logged in the django log if a users username includes a - character

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 254, in run_asgi
    result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
  File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/channels/routing.py", line 71, in __call__
    return await application(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/channels/security/websocket.py", line 37, in __call__
    return await self.application(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/channels/sessions.py", line 47, in __call__
    return await self.inner(dict(scope, cookies=cookies), receive, send)
  File "/usr/local/lib/python3.10/site-packages/channels/sessions.py", line 263, in __call__
    return await self.inner(wrapper.scope, receive, wrapper.send)
  File "/usr/local/lib/python3.10/site-packages/channels/auth.py", line 185, in __call__
    return await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/channels/middleware.py", line 26, in __call__
    return await self.inner(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/channels/routing.py", line 168, in __call__
    raise ValueError("No route found for path %r." % path)
ValueError: No route found for path 'ws/users/test-user/'.

To Reproduce
Steps to reproduce the behavior:

  1. Create a user incliding a - in their username
  2. Login with this user
  3. Observe the errors in the django log

Expected Behavior
Cleanly handle this username

@domwhewell-sage domwhewell-sage added the bug Something isn't working label May 17, 2024
@chrismaddalena
Copy link
Collaborator

Going forward, usernames will be hex-encoded to ensure any characters JavaScript may have a problem with are removed. This will be fixed in the next release. Thanks for letting us know!

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

No branches or pull requests

2 participants