diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index d32decfe59..4a436cb3a9 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -2,6 +2,8 @@ package middleware import ( "fmt" + "io" + "io/ioutil" "net/http" "regexp" "strings" @@ -104,6 +106,15 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle webdav.HandleWebdavError(w, b, err) } + + if r.ProtoMajor == 1 { + // https://github.com/owncloud/ocis/issues/5066 + // https://github.com/golang/go/blob/d5de62df152baf4de6e9fe81933319b86fd95ae4/src/net/http/server.go#L1357-L1417 + // https://github.com/golang/go/issues/15527 + + defer r.Body.Close() + _, _ = io.Copy(ioutil.Discard, r.Body) + } }) } }