|
|
@ -79,14 +79,15 @@ func isOriginAllowed(allows []string, origin string) bool {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func setHeader(w http.ResponseWriter, origin string) {
|
|
|
|
func setHeader(w http.ResponseWriter, origin string) {
|
|
|
|
w.Header().Set(allowOrigin, origin)
|
|
|
|
header := w.Header()
|
|
|
|
w.Header().Set(allowMethods, methods)
|
|
|
|
header.Set(allowOrigin, origin)
|
|
|
|
w.Header().Set(allowHeaders, allowHeadersVal)
|
|
|
|
header.Set(allowMethods, methods)
|
|
|
|
w.Header().Set(exposeHeaders, exposeHeadersVal)
|
|
|
|
header.Set(allowHeaders, allowHeadersVal)
|
|
|
|
|
|
|
|
header.Set(exposeHeaders, exposeHeadersVal)
|
|
|
|
if origin != allOrigins {
|
|
|
|
if origin != allOrigins {
|
|
|
|
w.Header().Set(allowCredentials, allowTrue)
|
|
|
|
header.Set(allowCredentials, allowTrue)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
w.Header().Set(maxAgeHeader, maxAgeHeaderVal)
|
|
|
|
header.Set(maxAgeHeader, maxAgeHeaderVal)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func setVaryHeaders(w http.ResponseWriter, r *http.Request) {
|
|
|
|
func setVaryHeaders(w http.ResponseWriter, r *http.Request) {
|
|
|
|