Merge pull request #6355 from owncloud/fix-cors-headers

fix preflight requests
This commit is contained in:
Michael Barz
2023-05-24 09:40:01 +02:00
committed by GitHub
9 changed files with 68 additions and 6 deletions
@@ -52,7 +52,7 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ri := router.ContextRoutingInfo(r.Context())
if isOIDCTokenAuth(r) || ri.IsRouteUnprotected() {
if isOIDCTokenAuth(r) || ri.IsRouteUnprotected() || r.Method == "OPTIONS" {
// Either this is a request that does not need any authentication or
// the authentication for this request is handled by the IdP.
next.ServeHTTP(w, r)