Closed
Description
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