You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever a user agent issues an HTTP request from a "privacy-
sensitive" context, the user agent MUST send the value "null" in the
Origin header field.
In this code, we should consider it:
// if we have an Origin header, check it against our allowlistorigin:=r.Header.Get("Origin")
iforigin!="" {
parsedOrigin, err:=url.Parse(origin)
iferr!=nil {
r=envError(r, ErrBadOrigin)
cs.opts.ErrorHandler.ServeHTTP(w, r)
return
}
if!sameOrigin(&requestURL, parsedOrigin) &&!slices.Contains(cs.opts.TrustedOrigins, parsedOrigin.Host) {
r=envError(r, ErrBadOrigin)
cs.opts.ErrorHandler.ServeHTTP(w, r)
return
}
}
Maybe just ignore the null value in the if origin sentence:
Activity