mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
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.
This commit is contained in:
parent
8b322648c8
commit
83b6619b16
1 changed files with 1 additions and 0 deletions
|
@ -193,6 +193,7 @@ void HttpConnection::respond() {
|
||||||
if (nb_fail >= MAX_AUTH_FAILED_ATTEMPTS) {
|
if (nb_fail >= MAX_AUTH_FAILED_ATTEMPTS) {
|
||||||
m_generator.setStatusLine(403, "Forbidden");
|
m_generator.setStatusLine(403, "Forbidden");
|
||||||
m_generator.setMessage(tr("Your IP address has been banned after too many failed authentication attempts."));
|
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());
|
m_generator.setContentEncoding(m_parser.acceptsEncoding());
|
||||||
write();
|
write();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue