1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00
curl/tests/data/test1156
Daniel Stenberg 6d176bee59
http: make 416 not fail with resume + CURLOPT_FAILONERRROR
When asked to resume a download, libcurl will convert that to HTTP logic
and if then the entire file is already transferred it will result in a
416 response from the HTTP server. With CURLOPT_FAILONERRROR set in that
scenario, it should *not* lead to an error return.

Updated test 1156, added test 1273

Reported-by: Jonathan Watt
Fixes #6740
Closes #6753
2021-03-17 08:26:46 +01:00

73 lines
1010 B
Plaintext

<testcase>
<info>
<keywords>
HTTP
HTTP GET
Content-Range
Resume
Range
</keywords>
</info>
# Server-side
<reply>
<data nocheck="yes">
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 5
body
</data>
<data1 nocheck="yes">
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 5
Content-Range: bytes 3/7
body
</data1>
<data2 nocheck="yes">
HTTP/1.1 416 Requested Range Not Satisfiable
Content-Type: text/html
Content-Length: 5
body
</data2>
<data3 nocheck="yes">
HTTP/1.1 416 Requested Range Not Satisfiable
Content-Type: text/html
Content-Length: 5
Content-Range: bytes */2
body
</data3>
</reply>
# Client-side
<client>
<server>
http
</server>
<tool>
lib1156
</tool>
<name>
HTTP resume/range fail range-error content-range combinations
</name>
<command>
http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<stderr mode="text">
URL: http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER
0
</stderr>
</verify>
</testcase>