From a432c00fcec3aac0c1dd2002ff6e50673272ea21 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Tue, 6 Feb 2024 10:28:05 +0100 Subject: [PATCH 1/3] 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 From a0cd76af8a8cc127985682e44ea88a1b05e984a6 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Tue, 6 Feb 2024 11:40:07 +0100 Subject: [PATCH 2/3] Add expected failures Co-authored-by: Victor Scharf Signed-off-by: Christian Richter --- tests/acceptance/expected-failures-on-OCIS-storage.md | 5 +++++ tests/acceptance/expected-failures-on-S3NG-storage.md | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/tests/acceptance/expected-failures-on-OCIS-storage.md b/tests/acceptance/expected-failures-on-OCIS-storage.md index 77200ddea4..9d2c3d16d3 100644 --- a/tests/acceptance/expected-failures-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-on-OCIS-storage.md @@ -287,5 +287,10 @@ _The below features have been added after I last categorized them. AFAICT they a - [coreApiWebdavMove2/moveFile.feature:121](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L121) - [coreApiWebdavMove2/moveFile.feature:126](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L126) +### [Fix Content-Dispositon header for download requests]( +- [coreApiVersions/fileVersions.feature:158](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L158) +- [coreApiVersions/fileVersions.feature:176](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L176) +) + - Note: always have an empty line at the end of this file. The bash script that processes this file may not process a scenario reference on the last line. diff --git a/tests/acceptance/expected-failures-on-S3NG-storage.md b/tests/acceptance/expected-failures-on-S3NG-storage.md index 84326adb30..30cf70c9c8 100644 --- a/tests/acceptance/expected-failures-on-S3NG-storage.md +++ b/tests/acceptance/expected-failures-on-S3NG-storage.md @@ -290,5 +290,9 @@ _The below features have been added after I last categorized them. AFAICT they a - [coreApiWebdavMove2/moveFile.feature:121](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L121) - [coreApiWebdavMove2/moveFile.feature:126](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L126) +### [Fix Content-Dispositon header for download requests]( +- [coreApiVersions/fileVersions.feature:158](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L158) +- [coreApiVersions/fileVersions.feature:176](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L176) + Note: always have an empty line at the end of this file. The bash script that processes this file may not process a scenario reference on the last line. From 427bc57de6340d10c386d93254a96e45485794b5 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 6 Feb 2024 17:49:32 +0545 Subject: [PATCH 3/3] adjust expected-failures for content-disposition header fix --- tests/acceptance/expected-failures-on-OCIS-storage.md | 6 ++++-- tests/acceptance/expected-failures-on-S3NG-storage.md | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/acceptance/expected-failures-on-OCIS-storage.md b/tests/acceptance/expected-failures-on-OCIS-storage.md index 9d2c3d16d3..71b2800041 100644 --- a/tests/acceptance/expected-failures-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-on-OCIS-storage.md @@ -287,10 +287,12 @@ _The below features have been added after I last categorized them. AFAICT they a - [coreApiWebdavMove2/moveFile.feature:121](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L121) - [coreApiWebdavMove2/moveFile.feature:126](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L126) -### [Fix Content-Dispositon header for download requests]( +### [Fix Content-Dispositon header for download requests](https://github.com/owncloud/ocis/issues/8361) - [coreApiVersions/fileVersions.feature:158](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L158) - [coreApiVersions/fileVersions.feature:176](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L176) -) +- [coreApiWebdavOperations/downloadFile.feature:283](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature#L283) +- [coreApiWebdavOperations/downloadFile.feature:284](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature#L284) +- [coreApiWebdavOperations/downloadFile.feature:289](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature#L289) - Note: always have an empty line at the end of this file. The bash script that processes this file may not process a scenario reference on the last line. diff --git a/tests/acceptance/expected-failures-on-S3NG-storage.md b/tests/acceptance/expected-failures-on-S3NG-storage.md index 30cf70c9c8..6a7360c8d7 100644 --- a/tests/acceptance/expected-failures-on-S3NG-storage.md +++ b/tests/acceptance/expected-failures-on-S3NG-storage.md @@ -290,9 +290,12 @@ _The below features have been added after I last categorized them. AFAICT they a - [coreApiWebdavMove2/moveFile.feature:121](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L121) - [coreApiWebdavMove2/moveFile.feature:126](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L126) -### [Fix Content-Dispositon header for download requests]( +### [Fix Content-Dispositon header for download requests](https://github.com/owncloud/ocis/issues/8361) - [coreApiVersions/fileVersions.feature:158](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L158) - [coreApiVersions/fileVersions.feature:176](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L176) +- [coreApiWebdavOperations/downloadFile.feature:283](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature#L283) +- [coreApiWebdavOperations/downloadFile.feature:284](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature#L284) +- [coreApiWebdavOperations/downloadFile.feature:289](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature#L289) Note: always have an empty line at the end of this file. The bash script that processes this file may not process a scenario reference on the last line.