We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 155bca6 commit 0e00760Copy full SHA for 0e00760
handshake.go
@@ -221,10 +221,10 @@ func authenticateOrigin(r *http.Request) error {
221
if err != nil {
222
return fmt.Errorf("failed to parse Origin header %q: %w", origin, err)
223
}
224
- if strings.EqualFold(u.Host, r.Host) {
225
- return nil
+ if !strings.EqualFold(u.Host, r.Host) {
+ return fmt.Errorf("request Origin %q is not authorized for Host %q", origin, r.Host)
226
227
- return fmt.Errorf("request Origin %q is not authorized for Host %q", origin, r.Host)
+ return nil
228
229
230
// DialOptions represents the options available to pass to Dial.
0 commit comments