|
|
|
|
|
by danielmg
1615 days ago
|
|
Reading the bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1749957#c5
and then the code, isn't there still a problem if content-length is not set by the server? Not that it should ever not be set but... if (contentLengthStart == -1) {
// There is no content-Length.
return;
}
That's the same flow it would have taken with the case sensitive code. |
|
"I'm just a random kibbitzer, so my apologies if this is off-base, but... isn't an even more fundamental problem here that the code is doing a naive string-based search in the first place? For example, I believe this is a valid HTTP header block that could be passed into this code:
GET / HTTP/1.1\r\nHost: example.com\r\nCookie: foo="Content-Length: 100"\r\n\r\n (In particular, GET requests normally don't have a content-length header at all, since the default if none is present is to assume an empty body.)
Wouldn't this cause the code to compute the wrong body length and break things?"