diff --git a/changelog/unreleased/fix-blanks-in-content-disposition-headers.md b/changelog/unreleased/fix-blanks-in-content-disposition-headers.md new file mode 100644 index 0000000000..0e4e0c82ec --- /dev/null +++ b/changelog/unreleased/fix-blanks-in-content-disposition-headers.md @@ -0,0 +1,6 @@ +Bugfix: Blanks in dav Content-Disposition header + +We've fixed the encoding of blanks in the dav `Content-Disposition` header. + +https://github.com/cs3org/reva/pull/4762 +https://github.com/owncloud/web/issues/11169 diff --git a/internal/http/services/owncloud/ocdav/net/builders.go b/internal/http/services/owncloud/ocdav/net/builders.go index f9bd903b43..727c59c03f 100644 --- a/internal/http/services/owncloud/ocdav/net/builders.go +++ b/internal/http/services/owncloud/ocdav/net/builders.go @@ -28,7 +28,7 @@ import ( // ContentDispositionAttachment builds a ContentDisposition Attachment header with various filename encodings func ContentDispositionAttachment(filename string) string { - return "attachment; filename*=UTF-8''" + url.QueryEscape(filename) + "; filename=\"" + filename + "\"" + return "attachment; filename*=UTF-8''" + url.PathEscape(filename) + "; filename=\"" + filename + "\"" } // RFC1123Z formats a CS3 Timestamp to be used in HTTP headers like Last-Modified