Skip to content

Return HTTP 426 status code when appropriateΒ #173

@nerg4l

Description

@nerg4l

At the moment during a handshake error the server will response with 400 status code for example:

HTTP/1.1 400 Bad Request
Content-Length: <content length>
Content-Type: text/plain; charset=utf-8

websocket protocol violation: Connection header "" does not contain Upgrade

However, wouldn't it be beneficial to respond with 426 status code when incorrect Connection/Upgrade header is given or the HTTP protocol of the request is bellow 1.1?

HTTP/1.1 426 Upgrade Required
Upgrade: WebSocket
Connection: Upgrade
Content-Length: <content length>
Content-Type: text/plain; charset=utf-8

websocket protocol violation: Connection header "" does not contain Upgrade

Also I would appreciate if there would be an option to disable the functionality of Accept which writes the error to the response and I could handle it "my way".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions