mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-15 14:02:20 +00:00
WebServer: Send the HTTP response headers in a single packet
This makes it easier to observe the protocol in packet logs.
This commit is contained in:
parent
efb694ecad
commit
80703ef7d9
Notes:
sideshowbarker
2024-07-19 09:30:52 +09:00
Author: https://github.com/awesomekling
Commit: 80703ef7d9
1 changed files with 6 additions and 4 deletions
|
@ -68,11 +68,13 @@ void Client::handle_request(ByteBuffer raw_request)
|
|||
return;
|
||||
}
|
||||
|
||||
m_socket->write("HTTP/1.0 200 OK\r\n");
|
||||
m_socket->write("Server: WebServer (SerenityOS)\r\n");
|
||||
m_socket->write("Content-Type: text/html\r\n");
|
||||
m_socket->write("\r\n");
|
||||
StringBuilder builder;
|
||||
builder.append("HTTP/1.0 200 OK\r\n");
|
||||
builder.append("Server: WebServer (SerenityOS)\r\n");
|
||||
builder.append("Content-Type: text/html\r\n");
|
||||
builder.append("\r\n");
|
||||
|
||||
m_socket->write(builder.to_string());
|
||||
m_socket->write(file->read_all());
|
||||
|
||||
log_response(200, request);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue