From 94c3c7a491e0c25cf2179efe04c2fbd80b370c1c Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 3 Dec 2020 12:31:11 +0100 Subject: [PATCH] macOS: Make sure that the reserved characters are not escaped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The URL for the PAC proxy that is passed needs to be preserved for the main URL part and not entirely percent encoded, only the query part typically needs to be encoded. So use toEncoded instead for a URL to ensure they are not percent encoded. This amends c163ec1dbf873781b77ea67d4449d643c166c0c4 Pick-to: 6.0 5.15 Change-Id: Ie41ab55f71be8e25c18775e61ce7b4d110c2ddbf Reviewed-by: Tor Arne Vestbø --- src/network/kernel/qnetworkproxy_mac.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/kernel/qnetworkproxy_mac.cpp b/src/network/kernel/qnetworkproxy_mac.cpp index e4d2663f7a..a8327a40fb 100644 --- a/src/network/kernel/qnetworkproxy_mac.cpp +++ b/src/network/kernel/qnetworkproxy_mac.cpp @@ -208,7 +208,7 @@ QCFType stringByAddingPercentEscapes(CFStringRef originalPath) { Q_ASSERT(originalPath); const auto qtPath = QString::fromCFString(originalPath); - const auto escaped = QString::fromUtf8(QUrl::toPercentEncoding(qtPath)); + const auto escaped = QString::fromUtf8(QUrl(qtPath).toEncoded()); return escaped.toCFString(); }