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

tool_cb_hdr: allow etag and content-disposition for 3xx reply #13484

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jay
Copy link
Member

@jay jay commented Apr 26, 2024

  • Parse etag and content-disposition headers for 3xx replies.

For example, a server may send a content-disposition filename header with a redirect reply (3xx) but not with the final response (2xx). Without this change curl would ignore the server's specified filename and continue to use the filename extracted from the user-specified URL.

Prior to this change, 75d79a4 had limited etag and content-disposition to 2xx replies only.

Reported-by: Morgan Willcock

Fixes #13302
Closes #xxxx

@bagder
Copy link
Member

bagder commented Apr 26, 2024

It would be good to also get a test or two for this.

@bagder
Copy link
Member

bagder commented Jun 12, 2024

I created two tests for this: 473 and 1487. If you first rebase your branch on a current master, the patches in this tarball should apply fine.

tests.tar.gz

@bagder
Copy link
Member

bagder commented Jun 12, 2024

I decided not to try to push these to your branch because I made them against a current master and they did not apply clean on your existing branch and then it quickly got complicated... If you want me to, I can branch off the work in a separate PR with your fix and my tests.

@jay
Copy link
Member Author

jay commented Jun 13, 2024

Thanks, I rebased and squashed them in, let's see what happens

- Parse etag and content-disposition headers for 3xx replies.

For example, a server may send a content-disposition filename header
with a redirect reply (3xx) but not with the final response (2xx).
Without this change curl would ignore the server's specified filename
and continue to use the filename extracted from the user-specified URL.

Prior to this change, 75d79a4 had limited etag and content-disposition
to 2xx replies only.

Tests-by: Daniel Stenberg

Reported-by: Morgan Willcock

Fixes curl#13302
Closes #xxxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Change in behavior for --remote-header-name
2 participants