]> git.saurik.com Git - apt.git/blobdiff - test/interactive-helper/aptwebserver.cc
test: Use a file to determine TEST_DEFAULT_GROUP
[apt.git] / test / interactive-helper / aptwebserver.cc
index c32f286b20a6c08daa7553021eaed5ce947ceb2f..950a17bc12557e917f4486fe000832e3fb20f0f4 100644 (file)
@@ -717,6 +717,15 @@ static void * handleClient(void * voidclient)                              /*{{{*/
               condition.clear();
            if (condition.empty() == false && strncmp(condition.c_str(), "bytes=", 6) == 0)
            {
+              std::string ranges = ',' + _config->Find("aptwebserver::response-header::Accept-Ranges") + ',';
+              ranges.erase(std::remove(ranges.begin(), ranges.end(), ' '), ranges.end());
+              if (ranges.find(",bytes,") == std::string::npos)
+              {
+                 // we handle it as an error here because we are a test server - a real one should just ignore it
+                 sendError(client, 400, *m, sendContent, "Client does range requests we don't support", headers);
+                 continue;
+              }
+
               time_t cache;
               std::string ifrange;
               if (_config->FindB("aptwebserver::support::if-range", true) == true)