mirror of
https://github.com/curl/curl.git
synced 2026-08-25 20:03:36 +03:00
tool_cb_hdr: allow etag and content-disposition for 3xx reply
- 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 https://github.com/curl/curl/issues/13302
Closes #13484
This commit is contained in:
parent
cb5c7039e8
commit
85efbb92b8
4 changed files with 129 additions and 3 deletions
62
tests/data/test1487
Normal file
62
tests/data/test1487
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
HTTP
|
||||
HTTP GET
|
||||
-J
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
<reply>
|
||||
<data nocheck="yes">
|
||||
HTTP/1.1 301 OK
|
||||
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
Content-Length: 6
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange
|
||||
|
||||
12345
|
||||
</data>
|
||||
</reply>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
# this relies on the debug feature to allow us to set directory to store the
|
||||
# -J output in
|
||||
<features>
|
||||
debug
|
||||
</features>
|
||||
<server>
|
||||
http
|
||||
</server>
|
||||
<name>
|
||||
HTTP GET with -J and Content-Disposition on 301
|
||||
</name>
|
||||
<setenv>
|
||||
CURL_TESTDIR=%LOGDIR
|
||||
</setenv>
|
||||
<command option="no-output,no-include">
|
||||
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<protocol>
|
||||
GET /%TESTNUMBER HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
User-Agent: curl/%VERSION
|
||||
Accept: */*
|
||||
|
||||
</protocol>
|
||||
<file name="%LOGDIR/name%TESTNUMBER">
|
||||
12345
|
||||
</file>
|
||||
|
||||
</verify>
|
||||
</testcase>
|
||||
Loading…
Add table
Add a link
Reference in a new issue