mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:08:10 +00:00
GHttp: Fix little bug in HTTP header parsing.
This commit is contained in:
parent
f93b3b7806
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