Merge pull request #12 from Natureshadow/feature-cors

Send Origin back as Access-Control-Allow-Origin
This commit is contained in:
Rodrigue Chakode 2022-04-29 10:44:03 +02:00 committed by GitHub
commit 9f7e837262
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -176,6 +176,9 @@ func MuxSecAllowedDomainsHandler(next http.Handler) http.Handler {
return
}
// Send the allowed origin back as CORS header
w.Header().Set("Access-Control-Allow-Origin", r.Header["Origin"][0])
next.ServeHTTP(w, r)
})
}