fix: stabilize runtime follow-up regressions
This commit is contained in:
+13
-1
@@ -745,7 +745,19 @@ StringMap split_http_headers(String s)
|
||||
while(header_start < lines.size() && trim(lines[header_start]) == "")
|
||||
header_start++;
|
||||
|
||||
if(header_start < lines.size() && lines[header_start].find(':') == String::npos)
|
||||
// A header line has its colon before any whitespace ("Host: x"); a request
|
||||
// line has a space first even when the URI contains colons
|
||||
// ("GET /x.uce?t=12:30 HTTP/1.1").
|
||||
bool first_line_is_header = false;
|
||||
if(header_start < lines.size())
|
||||
{
|
||||
String first_line = trim(lines[header_start]);
|
||||
size_t colon = first_line.find(':');
|
||||
size_t space = first_line.find_first_of(" \t");
|
||||
first_line_is_header = colon != String::npos && (space == String::npos || colon < space);
|
||||
}
|
||||
|
||||
if(header_start < lines.size() && !first_line_is_header)
|
||||
{
|
||||
String request_line = trim(lines[header_start]);
|
||||
result["REQUEST_METHOD"] = nibble(request_line, " ");
|
||||
|
||||
Reference in New Issue
Block a user