1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:17:42 +00:00

LibHTTP: Append port to Host header if it exists

This commit is contained in:
GeekFiftyFive 2022-03-29 19:59:06 +01:00 committed by Idan Horowitz
parent 0fd51ae811
commit 8fee285d72

View file

@ -41,6 +41,8 @@ ByteBuffer HttpRequest::to_raw_request() const
}
builder.append(" HTTP/1.1\r\nHost: ");
builder.append(m_url.host());
if (m_url.port().has_value())
builder.appendff(":{}", *m_url.port());
builder.append("\r\n");
for (auto& header : m_headers) {
builder.append(header.name);