From 0ae5de8c3cf3db350ee271c1c58008375036e7e9 Mon Sep 17 00:00:00 2001 From: Marco Cutecchia Date: Tue, 24 Aug 2021 21:10:58 +0200 Subject: [PATCH] WebServer: Add 'Content-Type' header for error responses Previously when the WebServer sent an error page the browser would show the raw HTML since we forgot to send the 'Content-Type' header --- Userland/Services/WebServer/Client.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Services/WebServer/Client.cpp b/Userland/Services/WebServer/Client.cpp index 081ed297c2..240889d578 100644 --- a/Userland/Services/WebServer/Client.cpp +++ b/Userland/Services/WebServer/Client.cpp @@ -288,6 +288,7 @@ void Client::send_error_response(unsigned code, HTTP::HttpRequest const& request builder.append(header); builder.append("\r\n"); } + builder.append("Content-Type: text/html; charset=UTF-8\r\n"); builder.append("\r\n"); builder.append("

");