]> git.saurik.com Git - apt.git/blobdiff - test/interactive-helper/aptwebserver.cc
no value for MultiArch field is 'no', not 'none'
[apt.git] / test / interactive-helper / aptwebserver.cc
index 6a411e24ea1e18a5fe11bf87c4ef0698f0572f07..411da0e8f93784fa4a3f39215c15aaa40980470b 100644 (file)
@@ -731,13 +731,15 @@ static void * handleClient(void * voidclient)                             /*{{{*/
                     if (filesize > filestart)
                     {
                        data.Skip(filestart);
-                       std::ostringstream contentlength;
-                       contentlength << "Content-Length: " << (filesize - filestart);
-                       headers.push_back(contentlength.str());
+                        // make sure to send content-range before conent-length
+                        // as regression test for LP: #1445239
                        std::ostringstream contentrange;
                        contentrange << "Content-Range: bytes " << filestart << "-"
                           << filesize - 1 << "/" << filesize;
                        headers.push_back(contentrange.str());
+                       std::ostringstream contentlength;
+                       contentlength << "Content-Length: " << (filesize - filestart);
+                       headers.push_back(contentlength.str());
                        sendHead(client, 206, headers);
                        if (sendContent == true)
                           sendFile(client, headers, data);
@@ -745,9 +747,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;
                     }