corrected regex string check for anyorigin(*) (#5117)

Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
This commit is contained in:
Hrishikesh Barman 2019-01-21 17:17:27 +05:30 committed by Goutham Veeramachaneni
parent 24f19f03db
commit 9c4e258651

View file

@ -36,7 +36,7 @@ func SetCORS(w http.ResponseWriter, o *regexp.Regexp, r *http.Request) {
w.Header().Set(k, v)
}
if o.String() == ".*" {
if o.String() == "^(?:.*)$" {
w.Header().Set("Access-Control-Allow-Origin", "*")
return
}