Skip to content

Enhancement to customize the HTTP error code upon authorization failure #1051

@jayyvis

Description

@jayyvis

socket io version : 0.9.10
source: Manager.prototype.handleHandshake

If there a way to pass the required HTTP error code upon authorization failure, it would be convenient for applications. Currently socket.io sends HTTP 403 by default.

writeErr(403, 'handshake unauthorized');

Actually during the authorization process, my application verifies the authentication details before allowing a client to get connected. And if the authentication fails, it would be appropriate to send a HTTP 401 rather than HTTP 403 so that the client shall retry with correct credentials.

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