Commit a167dc19 authored by Kenton Varda's avatar Kenton Varda

Add a little more detail to invalid response status line errors.

parent 21cee3c4
......@@ -900,18 +900,18 @@ HttpHeaders::ResponseOrProtocolError HttpHeaders::tryParseResponse(kj::ArrayPtr<
KJ_IF_MAYBE(version, consumeWord(ptr)) {
if (!version->startsWith("HTTP/")) {
return ProtocolError { 502, "Bad Gateway",
"ERROR: Invalid response status line.", content };
"ERROR: Invalid response status line (invalid protocol).", content };
}
} else {
return ProtocolError { 502, "Bad Gateway",
"ERROR: Invalid response status line.", content };
"ERROR: Invalid response status line (no spaces).", content };
}
KJ_IF_MAYBE(code, consumeNumber(ptr)) {
response.statusCode = *code;
} else {
return ProtocolError { 502, "Bad Gateway",
"ERROR: Invalid response status code.", content };
"ERROR: Invalid response status line (invalid status code).", content };
}
response.statusText = consumeLine(ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment