Skip to content

Missleading origin error message #247

Closed
@laliluna

Description

@laliluna

When a proxy does not correctly set the origin, I found the error message is missleading.

I got
Accept failed: failed to accept WebSocket connection: request Origin "http://localhost:5555" is not authorized for Host "localhost:9000"

so I introduced
OriginPatterns: []string{"http://localhost:5555"},

But the code is expecting the origin without the trailling http://

The error message in authenticateOrigin could use the value, it is actually checking, ie. u.Host instead of origin

return fmt.Errorf("request Origin %q is not authorized for Host %q", origin, r.Host)

Cheers Sebastian

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions