Skip to content

Commit

Permalink
trim: referer -> AllowOrigin
Browse files Browse the repository at this point in the history
  • Loading branch information
yzy613 committed Nov 28, 2024
1 parent 5521d76 commit 5b53596
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions net/ghttp/ghttp_response_cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ func (r *Response) DefaultCORSOptions() CORSOptions {
// Allow all anywhere origin in default.
if origin := r.Request.Header.Get("Origin"); origin != "" {
options.AllowOrigin = origin
} else if referer := r.Request.Referer(); referer != "" {
if p := gstr.PosR(referer, "/", 6); p != -1 {
options.AllowOrigin = referer[:p]
} else {
options.AllowOrigin = referer
}
}
return options
}
Expand Down

0 comments on commit 5b53596

Please sign in to comment.