Skip to content

Websocket: Connection header missing #1522

@StanKocken

Description

@StanKocken

Just by trying your experimental WebSocket support, I had an issue with an header.

Into the answer of the initial request, the headers into the answer are:

HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: 1IY6qmG8rC2qfPo5cpnqwY7nqlg=

Into WebSocketCall you're checking:

String headerConnection = response.header("Connection");
if (!"Upgrade".equalsIgnoreCase(headerConnection)) {

But I have the exception because "headerConnection" is null. Any idea why?

Is this condition necessary? Because just after you're checking:

String headerUpgrade = response.header("Upgrade");
if (!"websocket".equalsIgnoreCase(headerUpgrade)) { 

So if my connection is not "Upgrade", the header "Upgrade" should be null, right?
In my case "headerUpgrade" is equals to "websocket".
It's working when I tested to remove your condition on the "Connection" header.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions