From 5c498cdb6d72f759e0e384bc7a2cdc1be75906c4 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 6 Mar 2018 08:56:05 +0100 Subject: Revert "http: A response with Content-Length: 0 has no content" This reverts commit dd547ebaffd2aceb42e2908f1d5f0ab386af6cb1. LP: #1751225 --- methods/server.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'methods') 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::max()) return _error->Errno("HeaderLine", _("The HTTP server sent an invalid Content-Length header")); else if (*DownloadSizePtr == 0) -- cgit v1.2.3