mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:27:35 +00:00
WebServer: Add utf-8 charset to Content-Type header for text/plain
This commit is contained in:
parent
45db35ad04
commit
e34f199997
1 changed files with 4 additions and 1 deletions
|
@ -176,7 +176,10 @@ ErrorOr<void> Client::send_response(InputStream& response, HTTP::HttpRequest con
|
|||
builder.append("X-Frame-Options: SAMEORIGIN\r\n");
|
||||
builder.append("X-Content-Type-Options: nosniff\r\n");
|
||||
builder.append("Pragma: no-cache\r\n");
|
||||
builder.appendff("Content-Type: {}\r\n", content_info.type);
|
||||
if (content_info.type == "text/plain")
|
||||
builder.appendff("Content-Type: {}; charset=utf-8\r\n", content_info.type);
|
||||
else
|
||||
builder.appendff("Content-Type: {}\r\n", content_info.type);
|
||||
builder.appendff("Content-Length: {}\r\n", content_info.length);
|
||||
builder.append("\r\n");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue