Skip to content

Websocket returning 500 instead of 4XX when unable to resolve the path #2147

Open
@sprezz-arthur

Description

@sprezz-arthur

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions