fix: Implement Kopiermonster webdev dialect by returning 200 OK to GET requests

This commit is contained in:
NilsKaden 2024-11-12 14:22:30 +01:00 committed by Noah Kleiner
commit 0338eade59

View file

@ -249,11 +249,12 @@ func (s *webDavServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
dataprovider.UpdateLastLogin(&user)
// Kopiermonster speaks a 'special' webdav dialect and ceases working if we send a non-200 status code.
if s.checkRequestMethod(ctx, r, connection) {
w.Header().Set("Content-Type", "text/xml; charset=utf-8")
w.WriteHeader(http.StatusMultiStatus)
w.WriteHeader(http.StatusOK)
w.Write([]byte("")) //nolint:errcheck
writeLog(r, http.StatusMultiStatus, nil)
writeLog(r, http.StatusOK, nil)
return
}