fix: stabilize runtime follow-up regressions

This commit is contained in:
udo
2026-06-11 23:03:07 +00:00
parent 7f757654b6
commit 20db669589
37 changed files with 906 additions and 144 deletions
+13 -1
View File
@@ -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, " ");