diff options
| author | David Kalnischkies <david@kalnischkies.de> | 2021-09-16 22:02:26 +0200 |
|---|---|---|
| committer | David Kalnischkies <david@kalnischkies.de> | 2021-09-16 22:40:05 +0200 |
| commit | 1edf8551cef0a7db7fdcdd5d6b06aec2ea7bb70d (patch) | |
| tree | befc66005cda8b145949497fcf49ffe6f4ffc496 /test/integration | |
| parent | d013f8957c0d464e0059cc107ca79d887cf9f8aa (diff) | |
Use exact If-Range match in our test webserver
RFC7233 3.2 If-Range specifies the comparison to be an exact match,
not a less or equal, which makes no sense in this context anyhow.
Our server exists only to write our tests against it so this isn't much
of a practical issue. I did confirm with a crashing server that no test
(silently) depends on this or exhibits a different behaviour not
explicitly checked for.
Diffstat (limited to 'test/integration')
| -rwxr-xr-x | test/integration/test-http-if-range | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test/integration/test-http-if-range b/test/integration/test-http-if-range index ca9f3b2e6..462d731cf 100755 --- a/test/integration/test-http-if-range +++ b/test/integration/test-http-if-range @@ -31,7 +31,11 @@ validpartialfile() { head -n 5 "$TESTFILE" > "$DOWNFILE" touch -d "$(stat --format '%y' "${TESTFILE}")" "$DOWNFILE" } -badpartialfile() { +badolderpartialfile() { + head -n 5 "$TESTFILE" > "$DOWNFILE" + touch -d "$(stat --format '%y' "${TESTFILE}") - 1sec" "$DOWNFILE" +} +badnewerpartialfile() { head -n 5 "$TESTFILE" > "$DOWNFILE" touch -d 'now + 1hour' "$DOWNFILE" } @@ -52,8 +56,13 @@ testrun() { testwebserverlaststatuscode "$3" "$DOWNLOADLOG" testsuccess cmp "$TESTFILE" "$DOWNFILE" - badpartialfile - testdownloadfile "bad partial file $1" + badolderpartialfile + testdownloadfile "bad old partial file $1" + testwebserverlaststatuscode "$4" "$DOWNLOADLOG" + testsuccess cmp "$TESTFILE" "$DOWNFILE" + + badnewerpartialfile + testdownloadfile "bad new partial file $1" testwebserverlaststatuscode "$4" "$DOWNLOADLOG" testsuccess cmp "$TESTFILE" "$DOWNFILE" |
