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

[backport #4748] fix: quotes in content-disposition header #4761

Merged

Conversation

JammingBen
Copy link

@JammingBen JammingBen commented Jul 10, 2024

Backports #4748 to stable-2.19.

Needs to wait for #4762.

Replaces the quotes by actually encoding the filename in the dav `Content-Disposition` header. The value of the `filename*` parameter must not be surrounded by any quotes, but rather be encoded in the first place. See RFC-6266 for more details.

The quotes caused an issue where certain browsers would decode the quotes and falsely prepend them to the filename.
@JammingBen JammingBen self-assigned this Jul 10, 2024
@JammingBen JammingBen force-pushed the fix/content-disposition-header-stable branch from be75df9 to 0e27b01 Compare July 12, 2024 06:35
@JammingBen
Copy link
Author

@saw-jan Do you know how expected failures work for stable branches? I can't get CI to recognize the correct lines, I guess because the line numbers changed on master. I tried with coreApiWebdavOperations/downloadFile.feature:214, which is the correct line number on current master. And I tried coreApiWebdavOperations/downloadFile.feature:266, which is the correct number on stable-5.0. However, I can't get it to work with any of these.

@saw-jan
Copy link
Contributor

saw-jan commented Jul 15, 2024

@saw-jan Do you know how expected failures work for stable branches? I can't get CI to recognize the correct lines, I guess because the line numbers changed on master. I tried with coreApiWebdavOperations/downloadFile.feature:214, which is the correct line number on current master. And I tried coreApiWebdavOperations/downloadFile.feature:266, which is the correct number on stable-5.0. However, I can't get it to work with any of these.

As per the .drone.env, with stable-2.19 reva branch, the expected failure will try to match the line numbers from ocis master branch and commit 2e7f0252f2a1b2c8200bf0931274b9e9e83f3c0a

@saw-jan
Copy link
Contributor

saw-jan commented Jul 15, 2024

Line number should be according to this file: https://github.com/owncloud/ocis/blob/2e7f0252f2a1b2c8200bf0931274b9e9e83f3c0a/tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature

@JammingBen JammingBen force-pushed the fix/content-disposition-header-stable branch from 0e27b01 to de8d922 Compare July 15, 2024 12:13
@JammingBen
Copy link
Author

Line number should be according to this file: https://github.com/owncloud/ocis/blob/2e7f0252f2a1b2c8200bf0931274b9e9e83f3c0a/tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature

Based on this, I added downloadFile.feature:266 and downloadFile.feature:299 to the list of expected failures. But still CI is failing: https://drone.owncloud.com/cs3org/reva/4969/15/6

Or do I need to add all the failing lines, as in 284-296 and 317-321?

@saw-jan
Copy link
Contributor

saw-jan commented Jul 15, 2024

Based on this, I added downloadFile.feature:266 and downloadFile.feature:299 to the list of expected failures. But still CI is failing: https://drone.owncloud.com/cs3org/reva/4969/15/6

Or do I need to add all the failing lines, as in 284-296 and 317-321?

yeah, to make the ci green, all failing tests must be added to the list and remove the passing lines

@JammingBen
Copy link
Author

yeah, to make the ci green, all failing tests must be added to the list and remove the passing lines

Ahh okay, I though the test scenario line is sufficient. Got it, thanks!

Fixes the encoding of blanks in the dav `Content-Disposition` header.

This is a regression caused by cs3org#4748.
@JammingBen JammingBen force-pushed the fix/content-disposition-header-stable branch from de8d922 to 09ff1be Compare July 15, 2024 12:49
@JammingBen JammingBen marked this pull request as ready for review July 16, 2024 06:21
@JammingBen JammingBen requested review from labkode, a team and glpatcern as code owners July 16, 2024 06:21
@JammingBen JammingBen requested a review from micbar July 16, 2024 06:21
@JammingBen
Copy link
Author

@micbar This backport PR is generally ready, however, one build pipeline is failing: https://github.com/cs3org/reva/actions/runs/9939700539/job/27454800157?pr=4761. Doesn't look related to me, any idea what might be happening?

@dragonchaser
Copy link

dragonchaser commented Jul 25, 2024

@JammingBen you need to pick the Dockerfile.revad-cephfs changes from this commit: 650b056

uncommenting the sed in line 23 should probably be sufficient.

@JammingBen JammingBen force-pushed the fix/content-disposition-header-stable branch from be44a30 to c433508 Compare July 26, 2024 06:35
@JammingBen
Copy link
Author

@JammingBen you need to pick the Dockerfile.revad-cephfs changes from this commit: 650b056

uncommenting the sed in line 23 should probably be sufficient.

Applying all the changes to the file worked, thanks!

@JammingBen JammingBen merged commit 0e84ed8 into cs3org:stable-2.19 Jul 29, 2024
9 of 10 checks passed
@JammingBen JammingBen mentioned this pull request Sep 3, 2024
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants