From 8a9f0cbfaaa60b15342fa6c951578059770179b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Van=C3=AD=C4=8Dek?= Date: Mon, 25 Nov 2024 20:21:31 +0100 Subject: [PATCH] Backward compatible WebDAV lock token HTTP header (ie. for Windows) --- internal/http/services/owncloud/ocdav/locks.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/http/services/owncloud/ocdav/locks.go b/internal/http/services/owncloud/ocdav/locks.go index 5458ec4e58..4db9120059 100644 --- a/internal/http/services/owncloud/ocdav/locks.go +++ b/internal/http/services/owncloud/ocdav/locks.go @@ -649,5 +649,9 @@ func (s *svc) unlockReference(ctx context.Context, _ http.ResponseWriter, r *htt } func requestLockToken(r *http.Request) string { - return strings.TrimSuffix(strings.TrimPrefix(r.Header.Get(net.HeaderLockToken), "<"), ">") + h := r.Header.Get(net.HeaderLockToken) + if len(h) == 0 { + h = strings.TrimSuffix(strings.TrimPrefix(r.Header.Get(net.HeaderIf), "("), ")") + } + return strings.TrimSuffix(strings.TrimPrefix(h, "<"), ">") }