aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlxmlhttprequest.cpp
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2019-11-29 11:44:03 +0100
committerMaximilian Goldstein <max.goldstein@qt.io>2019-12-04 14:12:59 +0100
commit6a5f905317aee731153947c4cb884f6f1b00fdab (patch)
treed9711f88442728d2c3c4dfd67675fbba2a8ddfa9 /src/qml/qml/qqmlxmlhttprequest.cpp
parent1841a9e41d02c9b95a7eb3c47e09f6773da56a85 (diff)
qml/qqmlxmlhttprequest: Discard redirect response body
Discard response body if a redirect will be followed, otherwise you will end up with the whole redirect chains responses concatenated in responseText. Change-Id: I0beaabaf2f1f71f7d6ee756aa028e0409195a51d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlxmlhttprequest.cpp')
-rw-r--r--src/qml/qml/qqmlxmlhttprequest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp
index 4db0562c0e..df4639bb1d 100644
--- a/src/qml/qml/qqmlxmlhttprequest.cpp
+++ b/src/qml/qml/qqmlxmlhttprequest.cpp
@@ -1396,6 +1396,10 @@ void QQmlXMLHttpRequest::finished()
if (code.isValid() && code.toInt() == 303 && m_method != QLatin1String("GET"))
m_method = QStringLiteral("GET");
destroyNetwork();
+
+ // Discard redirect response body
+ m_responseEntityBody = QByteArray();
+
requestFromUrl(url);
return;
}