From 26472cd4bc2c5137c31b70dbfc88cc7865e85bfe Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 7 Jul 2023 16:17:39 +0200 Subject: [PATCH] Always send a language header in all requests Fixes: #10619 --- src/libsync/accessmanager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libsync/accessmanager.cpp b/src/libsync/accessmanager.cpp index a340f82a8b3..bf41921a6b3 100644 --- a/src/libsync/accessmanager.cpp +++ b/src/libsync/accessmanager.cpp @@ -62,6 +62,9 @@ QNetworkReply *AccessManager::createRequest(QNetworkAccessManager::Operation op, // Some firewalls reject requests that have a "User-Agent" but no "Accept" header newRequest.setRawHeader(QByteArrayLiteral("Accept"), QByteArrayLiteral("*/*")); + // Set the language, so messages from the server are localised correctly. + newRequest.setRawHeader("Accept-Language", QLocale().name().toUtf8()); + QByteArray verb = newRequest.attribute(QNetworkRequest::CustomVerbAttribute).toByteArray(); // For PROPFIND (assumed to be a WebDAV op), set xml/utf8 as content type/encoding // This needs extension