diff --git a/src/webui/abstractrequesthandler.cpp b/src/webui/abstractrequesthandler.cpp index fc9479100..0ec2b73c8 100644 --- a/src/webui/abstractrequesthandler.cpp +++ b/src/webui/abstractrequesthandler.cpp @@ -50,7 +50,7 @@ HttpResponse AbstractRequestHandler::run() if (isBanned()) { status(403, "Forbidden"); - print(QObject::tr("Your IP address has been banned after too many failed authentication attempts.")); + print(QObject::tr("Your IP address has been banned after too many failed authentication attempts."), CONTENT_TYPE_TXT); } else { diff --git a/src/webui/httptypes.h b/src/webui/httptypes.h index 614e9a4d2..9eabf577c 100644 --- a/src/webui/httptypes.h +++ b/src/webui/httptypes.h @@ -40,12 +40,12 @@ const QString HEADER_CONTENT_TYPE = "Content-Type"; const QString HEADER_CONTENT_ENCODING = "Content-Encoding"; const QString HEADER_CONTENT_LENGTH = "Content-Length"; -const QString CONTENT_TYPE_CSS = "text/css"; +const QString CONTENT_TYPE_CSS = "text/css; charset=UTF-8"; const QString CONTENT_TYPE_GIF = "image/gif"; -const QString CONTENT_TYPE_HTML = "text/html"; -const QString CONTENT_TYPE_JS = "text/javascript"; +const QString CONTENT_TYPE_HTML = "text/html; charset=UTF-8"; +const QString CONTENT_TYPE_JS = "text/javascript; charset=UTF-8"; const QString CONTENT_TYPE_PNG = "image/png"; -const QString CONTENT_TYPE_TXT = "text/plain"; +const QString CONTENT_TYPE_TXT = "text/plain; charset=UTF-8"; struct HttpEnvironment { diff --git a/src/webui/requesthandler.cpp b/src/webui/requesthandler.cpp index dc4bf0cc8..dea1a42ba 100644 --- a/src/webui/requesthandler.cpp +++ b/src/webui/requesthandler.cpp @@ -268,7 +268,7 @@ void RequestHandler::action_command_upload() { qWarning() << "I/O Error: Could not create temporary file"; status(500, "Internal Server Error"); - print(QByteArray("I/O Error: Could not create temporary file."), CONTENT_TYPE_TXT); + print(QObject::tr("I/O Error: Could not create temporary file."), CONTENT_TYPE_TXT); } } }