diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-08-12 22:13:09 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-08-13 08:49:35 +0200 |
commit | 148c049150cc39f2e40894c1684dc2aefea1117e (patch) | |
tree | c4cfe24e454cd27bc68005736c21db06dd0bbaa6 /test | |
parent | 9445fa62386c80c9822e77484d30b2109aa0f2dc (diff) |
http(s): allow empty values for header fields
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
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/test-bug-778375-server-has-no-reason-phrase | 1 | ||||
-rw-r--r-- | test/interactive-helper/aptwebserver.cc | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/test/integration/test-bug-778375-server-has-no-reason-phrase b/test/integration/test-bug-778375-server-has-no-reason-phrase index bce41235f..28e31e069 100755 --- a/test/integration/test-bug-778375-server-has-no-reason-phrase +++ b/test/integration/test-bug-778375-server-has-no-reason-phrase @@ -11,6 +11,7 @@ echo 'found' > aptarchive/working changetohttpswebserver -o 'aptwebserver::redirect::replace::/redirectme/=/' \ -o 'aptwebserver::httpcode::200=200' -o 'aptwebserver::httpcode::404=404' \ -o 'aptwebserver::httpcode::301=301' +webserverconfig 'aptwebserver::empty-response-header::' 'foobar' testdownload() { rm -f downfile 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::list<std::string _config->Set("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<std::string> addheaders = VectorizeString(buffer.str(), '\n'); for (std::vector<std::string>::const_iterator h = addheaders.begin(); h != addheaders.end(); ++h) |