From f02a738166546767f9de1520077fa772093594f4 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Tue, 6 Feb 2024 17:15:04 +0545 Subject: [PATCH] test: API coverage for Content-Disposition header with file having comma --- .../downloadFile.feature | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature b/tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature index 34b7be65f03..e60e2389874 100644 --- a/tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature +++ b/tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature @@ -262,31 +262,35 @@ Feature: download file | dav-path-version | | spaces | - @smokeTest + @smokeTest @issue-8361 Scenario Outline: downloading a file should serve security headers Given using DAV path - When user "Alice" downloads file "/welcome.txt" using the WebDAV API + And user "Alice" has uploaded file with content "test file" to "/" + When user "Alice" downloads file "/" using the WebDAV API Then the HTTP status code should be "200" And the following headers should be set - | header | value | - | Content-Disposition | attachment; filename*=UTF-8''welcome.txt; filename="welcome.txt" | - | Content-Security-Policy | default-src 'none'; | - | X-Content-Type-Options | nosniff | - | X-Download-Options | noopen | - | X-Frame-Options | SAMEORIGIN | - | X-Permitted-Cross-Domain-Policies | none | - | X-Robots-Tag | none | - | X-XSS-Protection | 1; mode=block | - And the downloaded content should start with "Welcome" + | header | value | + | Content-Disposition | attachment; filename*=UTF-8''""; filename="" | + | Content-Security-Policy | default-src 'none'; | + | X-Content-Type-Options | nosniff | + | X-Download-Options | noopen | + | X-Frame-Options | SAMEORIGIN | + | X-Permitted-Cross-Domain-Policies | none | + | X-Robots-Tag | none | + | X-XSS-Protection | 1; mode=block | + And the downloaded content should be "test file" Examples: - | dav-path-version | - | old | - | new | + | dav-path-version | file | + | old | textfile.txt | + | old | comma,.txt | + | new | textfile.txt | + | new | comma,.txt | @skipOnRevaMaster Examples: - | dav-path-version | - | spaces | + | dav-path-version | file | + | spaces | textfile.txt | + | spaces | comma,.txt | Scenario: download a zero byte size file