From 148c049150cc39f2e40894c1684dc2aefea1117e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 12 Aug 2016 22:13:09 +0200 Subject: http(s): allow empty values for header fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems completely pointless from a server-POV to sent empty header fields, so most of them don't do it (simply proven by this limitation existing since day one) – but it is technically allowed by the RFC as the surounding whitespaces are optional and Github seems to like sending "X-Geo-Block-List:\r\n" since recently (bug reports in other http clients indicate July) at least sometimes as the reporter claims to have seen it on https only even through it can happen with both. Closes: 834048 --- test/interactive-helper/aptwebserver.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/interactive-helper/aptwebserver.cc') diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc index 817760ec3..c32f286b2 100644 --- a/test/interactive-helper/aptwebserver.cc +++ b/test/interactive-helper/aptwebserver.cc @@ -122,6 +122,9 @@ static bool sendHead(int const client, int const httpcode, std::listSet("APTWebserver::Last-Status-Code", httpcode); std::stringstream buffer; + auto const empties = _config->FindVector("aptwebserver::empty-response-header"); + for (auto && e: empties) + buffer << e << ":" << std::endl; _config->Dump(buffer, "aptwebserver::response-header", "%t: %v%n", false); std::vector addheaders = VectorizeString(buffer.str(), '\n'); for (std::vector::const_iterator h = addheaders.begin(); h != addheaders.end(); ++h) -- cgit v1.2.3