summaryrefslogtreecommitdiff
path: root/test/integration/test-partial-file-support
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-08-11 18:24:35 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-08-16 18:49:37 +0200
commitd94b1d80d8326334d17f6a43061368e783b8e0aa (patch)
tree7b248c4adecf84184dc823ada6f654c7e0f46f06 /test/integration/test-partial-file-support
parentebdb6f1810a20ac240b5b2192dc2e6532ff149d2 (diff)
don't sent Range requests if we know its not accepted
If the server told us in a previous request that it isn't supporting Ranges with bytes via an Accept-Ranges header missing bytes, we don't try to formulate requests using Ranges.
Diffstat (limited to 'test/integration/test-partial-file-support')
-rwxr-xr-xtest/integration/test-partial-file-support8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/integration/test-partial-file-support b/test/integration/test-partial-file-support
index 1c5d120d8..9b5eed1e5 100755
--- a/test/integration/test-partial-file-support
+++ b/test/integration/test-partial-file-support
@@ -96,6 +96,7 @@ followuprequest() {
testrun() {
webserverconfig 'aptwebserver::support::range' 'true'
+ webserverconfig 'aptwebserver::response-header::Accept-Ranges' 'bytes'
local DOWN='./downloaded/testfile'
copysource $TESTFILE 0 $DOWN
@@ -125,7 +126,11 @@ testrun() {
testdownloadfile 'old data' "${1}/testfile" "$DOWN" '='
testwebserverlaststatuscode '200' "$DOWNLOADLOG"
- webserverconfig 'aptwebserver::support::range' 'false'
+ if [ "${1%%:*}" = 'https' ] && expr match "$1" "^.*/redirectme$" >/dev/null; then
+ webserverconfig 'aptwebserver::response-header::Accept-Ranges' 'none'
+ else
+ webserverconfig 'aptwebserver::support::range' 'false'
+ fi
copysource $TESTFILE 20 $DOWN
testdownloadfile 'no server support' "${1}/testfile" "$DOWN" '='
@@ -148,4 +153,5 @@ changetohttpswebserver
serverconfigs "https://localhost:${APTHTTPSPORT}"
webserverconfig 'aptwebserver::redirect::replace::/redirectme/' "https://localhost:${APTHTTPSPORT}/"
+serverconfigs "https://localhost:${APTHTTPSPORT}/redirectme"
serverconfigs "http://localhost:${APTHTTPPORT}/redirectme"