From 9c4e258651d5d5a0986e83e4922121c482402bac Mon Sep 17 00:00:00 2001 From: Hrishikesh Barman Date: Mon, 21 Jan 2019 17:17:27 +0530 Subject: [PATCH] corrected regex string check for anyorigin(*) (#5117) Signed-off-by: Hrishikesh Barman --- util/httputil/cors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/httputil/cors.go b/util/httputil/cors.go index 6e0b5bbfc..fdd5d3cd2 100644 --- a/util/httputil/cors.go +++ b/util/httputil/cors.go @@ -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 }