From 9144e3aa4b559d938e59944ed224e3baea816be7 Mon Sep 17 00:00:00 2001 From: Roman Vanicek Date: Tue, 10 Dec 2024 21:49:58 +0100 Subject: [PATCH] Missing file in previous commit --- patches/003-dav-locks-parsing.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 patches/003-dav-locks-parsing.patch diff --git a/patches/003-dav-locks-parsing.patch b/patches/003-dav-locks-parsing.patch new file mode 100644 index 0000000..f6ae495 --- /dev/null +++ b/patches/003-dav-locks-parsing.patch @@ -0,0 +1,18 @@ +--- a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/locks.go ++++ b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/locks.go +@@ -649,5 +649,13 @@ 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 = r.Header.Get(net.HeaderIf) ++ if untagged := strings.Index(h, "(<"); untagged > 0 { ++ h = h[untagged:] ++ } ++ h = strings.TrimSuffix(strings.TrimPrefix(h, "("), ")") ++ } ++ return strings.TrimSuffix(strings.TrimPrefix(h, "<"), ">") + } +