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:
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)
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:
path(r"ws/chat/<int:room_id>/", consumers.ChatConsumer.as_asgi())Now connecting to a room using int will behave normally:
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
WebSocket REJECT /ws/chat/banana/.(status 403)CURRENT BEHAVIOR
ValueError: No route found for path 'ws/chat/banana/'.(status 500)