mirror of
https://github.com/RGBCube/serenity
synced 2025-06-28 16:42:12 +00:00
LibHTTP: Make sure we're not sending an empty path in requests
When the path component of the request URL was empty we'd end up sending requests like "GET HTTP/1.1" (note the missing /). This ensures that we always send a path.
This commit is contained in:
parent
79d3910145
commit
f1dc8e12d2
1 changed files with 4 additions and 1 deletions
|
@ -37,7 +37,10 @@ ByteBuffer HttpRequest::to_raw_request() const
|
|||
StringBuilder builder;
|
||||
builder.append(method_name());
|
||||
builder.append(' ');
|
||||
builder.append(m_url.path());
|
||||
if (!m_url.path().is_empty())
|
||||
builder.append(m_url.path());
|
||||
else
|
||||
builder.append('/');
|
||||
if (!m_url.query().is_empty()) {
|
||||
builder.append('?');
|
||||
builder.append(m_url.query());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue