1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00
curl/tests/data/test1273
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

79 lines
1.0 KiB
Plaintext

<testcase>
# also verified by 1156 in libcurl API terms
<info>
<keywords>
HTTP
HTTP GET
Resume
</keywords>
</info>
# Server-side
<reply>
<data>
HTTP/1.1 416 Invalid range
Connection: close
Content-Length: 0
</data>
# The file data that exists at the start of the test must be included in
# the verification.
<datacheck>
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
HTTP/1.1 416 Invalid range
Connection: close
Content-Length: 0
</datacheck>
</reply>
# Client-side
<client>
<server>
http
</server>
<name>
-f and resume transfer of an entirely-downloaded file
</name>
<command>
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C - -f
</command>
<file name="log/curl%TESTNUMBER.out">
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
</file>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol>
GET /%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Range: bytes=100-
User-Agent: curl/%VERSION
Accept: */*
</protocol>
</verify>
</testcase>