Switch on CORS by default if not specified (#928)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2021-02-11 20:10:48 -05:00
1 parent 433998494a
commit e9da3a871d
9 files changed
+62 -23

No files matched your search

+1 -1
View File
@@ -260,7 +260,7 @@ func wrapHandlerWithCors(h http.Handler, props HandlerProperties) http.Handler {
}, props.ListenerConfig.CorsAllowedHeaders...)
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
if !props.ListenerConfig.CorsEnabled {
if props.ListenerConfig.CorsEnabled == nil || !*props.ListenerConfig.CorsEnabled {
h.ServeHTTP(w, req)
return
}