When allowed_origins is "*" use that in response (#2289)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2022-07-25 14:05:00 -04:00
1 parent 24cf580045
commit 67d789cb6d
2 files changed
+17 -1

No files matched your search

+3
View File
@@ -419,6 +419,9 @@ func wrapHandlerWithCors(h http.Handler, props HandlerProperties) http.Handler {
case len(allowedOrigins) == 1 && allowedOrigins[0] == "*":
valid = true
// When allowed origins is "*" we want to return that rather than
// round-tripping any user-specified value
origin = "*"
default:
valid = strutil.StrListContains(allowedOrigins, origin)