diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-05-12 00:30:16 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-05-12 00:30:16 +0200 |
commit | dcbb364fc69e1108b3fea3adb12a7ba83d9af467 (patch) | |
tree | 5422a146993545e1d9b3bec04b7e5ebfed598e00 /test/interactive-helper | |
parent | 88593886a42025d51d76051da5929b044e42efee (diff) |
detect 416 complete file in partial by expected hash
If we have the expected hashes we can check with them if the file we
have in partial we got a 416 for is the expected file. We detected this
with same-size before, but not every server sends a good Content-Range
header with a 416 response.
Diffstat (limited to 'test/interactive-helper')
-rw-r--r-- | test/interactive-helper/aptwebserver.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc index 6a411e24e..c933060e7 100644 --- a/test/interactive-helper/aptwebserver.cc +++ b/test/interactive-helper/aptwebserver.cc @@ -745,9 +745,12 @@ static void * handleClient(void * voidclient) /*{{{*/ } else { - std::ostringstream contentrange; - contentrange << "Content-Range: bytes */" << filesize; - headers.push_back(contentrange.str()); + if (_config->FindB("aptwebserver::support::content-range", true) == true) + { + std::ostringstream contentrange; + contentrange << "Content-Range: bytes */" << filesize; + headers.push_back(contentrange.str()); + } sendError(client, 416, *m, sendContent, "", headers); break; } |