summaryrefslogtreecommitdiff
path: root/tests/data
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-03-16 14:41:06 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-03-17 08:26:46 +0100
commit6d176bee59558a1ec9dffc6633aa05e713af73f0 (patch)
treea9004cd4a0edd3ddc71967bdfb9e56051f091a2f /tests/data
parente8e7ef3612d28e98b7b072f8d48c2a9f0b4662b5 (diff)
downloadcurl-6d176bee59558a1ec9dffc6633aa05e713af73f0.tar.gz
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
Diffstat (limited to 'tests/data')
-rw-r--r--tests/data/Makefile.inc3
-rw-r--r--tests/data/test11567
-rw-r--r--tests/data/test127378
3 files changed, 84 insertions, 4 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index 6306b5980..2c7a0ca89 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -153,7 +153,8 @@ test1240 test1241 test1242 test1243 test1244 test1245 test1246 test1247 \
test1248 test1249 test1250 test1251 test1252 test1253 test1254 test1255 \
test1256 test1257 test1258 test1259 test1260 test1261 test1262 test1263 \
test1264 test1265 test1266 test1267 test1268 test1269 test1270 test1271 \
-test1272 \
+test1272 test1273 \
+\
test1280 test1281 test1282 test1283 test1284 test1285 test1286 test1287 \
test1288 test1289 test1290 test1291 test1292 test1293 test1294 test1295 \
test1296 test1297 test1298 test1299 test1300 test1301 test1302 test1303 \
diff --git a/tests/data/test1156 b/tests/data/test1156
index f78dc998f..ff57bb0ec 100644
--- a/tests/data/test1156
+++ b/tests/data/test1156
@@ -58,14 +58,15 @@ lib1156
HTTP resume/range fail range-error content-range combinations
</name>
<command>
-http://%HOSTIP:%HTTPPORT/want/1156
+http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER
</command>
</client>
# Verify data after the test has been "shot"
<verify>
-<errorcode>
+<stderr mode="text">
+URL: http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER
0
-</errorcode>
+</stderr>
</verify>
</testcase>
diff --git a/tests/data/test1273 b/tests/data/test1273
new file mode 100644
index 000000000..61d475a2e
--- /dev/null
+++ b/tests/data/test1273
@@ -0,0 +1,78 @@
+<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>