]> git.ipfire.org Git - thirdparty/curl.git/commit
tool_cb_hdr: with -J, use the redirect name as a backup
authorDaniel Stenberg <daniel@haxx.se>
Sun, 25 Jan 2026 15:35:53 +0000 (16:35 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 26 Jan 2026 11:53:03 +0000 (12:53 +0100)
commitfa6a46473e6d4f97aff56a0bd823229052c8c2d2
tree2d706fdb1790b29c2c5f6a9a5316f0616e88f926
parent146de2460a68d06c29d4f4723ca33f9079dcf43f
tool_cb_hdr: with -J, use the redirect name as a backup

The -J / --remote-header-name logic now records the file name part used
in the redirects so that it can use the last one as a name if no
Content-Disposition header arrives.

Add tests to verify:

1641: -J with a redirect and extract the CD contents in the second
response

1642: -J with a redirect but no Content-Disposition, use the name from
the Location: header

1643: -J with two redirects, using the last file name and also use
queries and fragments to verify them stripped off

Closes #20430
docs/TODO.md
docs/cmdline-opts/remote-header-name.md
src/tool_cb_hdr.c
src/tool_sdecls.h
tests/data/Makefile.am
tests/data/test1641 [new file with mode: 0644]
tests/data/test1642 [new file with mode: 0644]
tests/data/test1643 [new file with mode: 0644]