summaryrefslogtreecommitdiff
path: root/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp')
-rw-r--r--Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index 631adf37d..0ce68838e 100644
--- a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -609,6 +609,7 @@ void QNetworkReplyHandler::sendResponseIfNeeded()
response.setHTTPHeaderField(String(pair.first.constData(), pair.first.size()), String(pair.second.constData(), pair.second.size()));
}
+ // Note: Qt sets RedirectionTargetAttribute only for 3xx responses, so Location header in 201 responce won't affect this code
QUrl redirection = m_replyWrapper->reply()->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
if (redirection.isValid()) {
redirect(response, redirection);
@@ -651,8 +652,10 @@ void QNetworkReplyHandler::redirect(ResourceResponse& response, const QUrl& redi
ASSERT(!m_queue.deferSignals());
QUrl currentUrl = m_replyWrapper->reply()->url();
+
+ // RFC7231 section 7.1.2
QUrl newUrl = currentUrl.resolved(redirection);
- if (currentUrl.hasFragment())
+ if (!newUrl.hasFragment() && currentUrl.hasFragment())
newUrl.setFragment(currentUrl.fragment());
ResourceHandleClient* client = m_resourceHandle->client();