mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-24 13:58:12 -05:00
Merge pull request #42 from owncloud/add-header-to-allowed-headers
add header to access-control-allow-headers
This commit is contained in:
5
changelog/unreleased/add-header-to-cors-handler.md
Normal file
5
changelog/unreleased/add-header-to-cors-handler.md
Normal file
@@ -0,0 +1,5 @@
|
||||
Change: Add header to cors handler
|
||||
|
||||
The `x-requested-with` header was added to allow ajax requests.
|
||||
|
||||
https://github.com/owncloud/ocis-pkg/issues/41
|
||||
@@ -24,7 +24,7 @@ func Cors(next http.Handler) http.Handler {
|
||||
} else {
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE, OPTIONS")
|
||||
w.Header().Set("Access-Control-Allow-Headers", "authorization, origin, content-type, accept")
|
||||
w.Header().Set("Access-Control-Allow-Headers", "authorization, origin, content-type, accept, x-requested-with")
|
||||
w.Header().Set("Allow", "HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS")
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
||||
Reference in New Issue
Block a user