We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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"
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"},
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
The text was updated successfully, but these errors were encountered:
Great catch!
The error message should be fixed to print just the host.
Sorry, something went wrong.
accept.go: Improve unauthorized origin error message
29251d0
Closes #247
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: