From a432c00fcec3aac0c1dd2002ff6e50673272ea21 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Tue, 6 Feb 2024 10:28:05 +0100 Subject: [PATCH] fix content-dispostion header in dav Signed-off-by: Christian Richter --- changelog/unreleased/fix-content-disposition-header.md | 6 ++++++ internal/http/services/owncloud/ocdav/net/builders.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/fix-content-disposition-header.md diff --git a/changelog/unreleased/fix-content-disposition-header.md b/changelog/unreleased/fix-content-disposition-header.md new file mode 100644 index 0000000000..896ad59994 --- /dev/null +++ b/changelog/unreleased/fix-content-disposition-header.md @@ -0,0 +1,6 @@ +Bugfix: Fix Content-Disposition header in dav + +We have added missing quotes to the Content-Disposition header in the dav service. This fixes an issue with files containing special characters in their names. + +https://github.com/cs3org/reva/pull/4498 +https://github.com/owncloud/ocis/issues/8361 diff --git a/internal/http/services/owncloud/ocdav/net/builders.go b/internal/http/services/owncloud/ocdav/net/builders.go index 0498072b6c..be7b8fdeec 100644 --- a/internal/http/services/owncloud/ocdav/net/builders.go +++ b/internal/http/services/owncloud/ocdav/net/builders.go @@ -27,7 +27,7 @@ import ( // ContentDispositionAttachment builds a ContentDisposition Attachment header with various filename encodings func ContentDispositionAttachment(filename string) string { - return "attachment; filename*=UTF-8''" + filename + "; filename=\"" + filename + "\"" + return "attachment; filename*=UTF-8''\"" + filename + "\"; filename=\"" + filename + "\"" } // RFC1123Z formats a CS3 Timestamp to be used in HTTP headers like Last-Modified