summaryrefslogtreecommitdiff
path: root/methods/server.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2018-03-06 08:56:05 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2018-03-06 08:56:05 +0100
commit5c498cdb6d72f759e0e384bc7a2cdc1be75906c4 (patch)
tree27a05a03bd2ac8d547a14e45a684266ee67614f3 /methods/server.cc
parent21d0746b5d8a3784bfc8f795d41f3a0c74339dee (diff)
Revert "http: A response with Content-Length: 0 has no content"
This reverts commit dd547ebaffd2aceb42e2908f1d5f0ab386af6cb1. LP: #1751225
Diffstat (limited to 'methods/server.cc')
-rw-r--r--methods/server.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/methods/server.cc b/methods/server.cc
index 5afe42eba..cac77e24c 100644
--- a/methods/server.cc
+++ b/methods/server.cc
@@ -163,9 +163,6 @@ bool ServerState::HeaderLine(string Line)
if (stringcasecmp(Tag,"Content-Length:") == 0)
{
- auto ContentLength = strtoull(Val.c_str(), NULL, 10);
- if (ContentLength == 0)
- return true;
if (Encoding == Closes)
Encoding = Stream;
HaveContent = true;
@@ -174,7 +171,7 @@ bool ServerState::HeaderLine(string Line)
if (Result == 416)
DownloadSizePtr = &JunkSize;
- *DownloadSizePtr = ContentLength;
+ *DownloadSizePtr = strtoull(Val.c_str(), NULL, 10);
if (*DownloadSizePtr >= std::numeric_limits<unsigned long long>::max())
return _error->Errno("HeaderLine", _("The HTTP server sent an invalid Content-Length header"));
else if (*DownloadSizePtr == 0)