summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--methods/basehttp.cc2
-rwxr-xr-xtest/integration/test-bug-778375-server-has-no-reason-phrase2
2 files changed, 3 insertions, 1 deletions
diff --git a/methods/basehttp.cc b/methods/basehttp.cc
index c3d570c83..47dabf960 100644
--- a/methods/basehttp.cc
+++ b/methods/basehttp.cc
@@ -85,7 +85,7 @@ bool RequestState::HeaderLine(string const &Line) /*{{{*/
if (Line.empty() == true)
return true;
- if (Line.size() > 4 && stringcasecmp(Line.data(), Line.data()+4, "HTTP") == 0)
+ if (Result == 0 && Line.size() > 4 && stringcasecmp(Line.data(), Line.data() + 4, "HTTP") == 0)
{
// Evil servers return no version
if (Line[4] == '/')
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 28e31e069..e04f4850f 100755
--- a/test/integration/test-bug-778375-server-has-no-reason-phrase
+++ b/test/integration/test-bug-778375-server-has-no-reason-phrase
@@ -12,6 +12,8 @@ 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'
+webserverconfig 'aptwebserver::response-header::HTTP-Trigger-Field' 'bug'
+webserverconfig 'aptwebserver::response-header::Httputter-Trigger-Field' 'bug'
testdownload() {
rm -f downfile