From 83b6619b16fe130b0d7bc24535ca1eac02290813 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Thu, 16 Oct 2014 23:10:18 +0100 Subject: [PATCH] WebUI: Set correct HTTP Content-Type in case of forbidden access The error message is an utf-8 string. With no charset specified, web browsers will likely use the wrong one making reading the message in some languages impossibile. --- src/webui/httpconnection.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/webui/httpconnection.cpp b/src/webui/httpconnection.cpp index be975394e..092b749e2 100644 --- a/src/webui/httpconnection.cpp +++ b/src/webui/httpconnection.cpp @@ -193,6 +193,7 @@ void HttpConnection::respond() { if (nb_fail >= MAX_AUTH_FAILED_ATTEMPTS) { m_generator.setStatusLine(403, "Forbidden"); m_generator.setMessage(tr("Your IP address has been banned after too many failed authentication attempts.")); + m_generator.setContentType("text/plain; charset=utf-8"); m_generator.setContentEncoding(m_parser.acceptsEncoding()); write(); return;