Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] extend API test coverage for content-disposition header #8378

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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-version> DAV path
When user "Alice" downloads file "/welcome.txt" using the WebDAV API
And user "Alice" has uploaded file with content "test file" to "/<file>"
When user "Alice" downloads file "/<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''"<file>"; filename="<file>" |
| 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
Expand Down