mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-16 06:22:17 +00:00
GHttp: Fix little bug in HTTP header parsing.
This commit is contained in:
parent
f93b3b7806
commit
71b6436552
Notes:
sideshowbarker
2024-07-19 14:47:45 +09:00
Author: https://github.com/awesomekling
Commit: 71b6436552
1 changed files with 2 additions and 2 deletions
|
@ -74,10 +74,10 @@ void GHttpNetworkJob::start()
|
||||||
}
|
}
|
||||||
auto name = parts[0];
|
auto name = parts[0];
|
||||||
if (chomped_line.length() < name.length() + 2) {
|
if (chomped_line.length() < name.length() + 2) {
|
||||||
printf("Malformed HTTP header\n");
|
printf("Malformed HTTP header: '%s' (%d)\n", chomped_line.characters(), chomped_line.length());
|
||||||
return deferred_invoke([this](auto&){ did_fail(GNetworkJob::Error::ProtocolFailed); });
|
return deferred_invoke([this](auto&){ did_fail(GNetworkJob::Error::ProtocolFailed); });
|
||||||
}
|
}
|
||||||
auto value = chomped_line.substring(name.length() + 2, line.size() - name.length() - 2);
|
auto value = chomped_line.substring(name.length() + 2, chomped_line.length() - name.length() - 2);
|
||||||
m_headers.set(name, value);
|
m_headers.set(name, value);
|
||||||
printf("[%s] = '%s'\n", name.characters(), value.characters());
|
printf("[%s] = '%s'\n", name.characters(), value.characters());
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue