Open
Description
What is the expected behavior when attempting to access a path not available in websocket_urlpatterns
?
Currently my application will cause a status code 500 and I would hope to have a 404 (or 403) instead.
HOW TO REPRODUCE:
- Recreate the tutorial chat app up to the second step: https://channels.readthedocs.io/en/latest/tutorial/part_2.html
- Modify the path
path(r"ws/chat/<int:room_id>/", consumers.ChatConsumer.as_asgi())
Now connecting to a room using int will behave normally:
- Create a room named 42:
WebSocket CONNECT /ws/chat/42/ [127.0.0.1:57662]
But when attempting to create a room with a non-int name, the behavior seems strange.
EXPECTED BEHAVIOR
- Create a room named "banana":
WebSocket REJECT /ws/chat/banana/.
(status 403)
CURRENT BEHAVIOR
- Create a room named "banana":
ValueError: No route found for path 'ws/chat/banana/'.
(status 500)
Metadata
Metadata
Assignees
Labels
No labels