summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2017-09-29 04:17:27 +0000
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2017-09-29 09:52:27 +0000
commit617ba6f1c40edb40f0364603d8201dd2413fdf69 (patch)
tree61ec7a0f5136b19e1472ed45590089948e798b75 /src/network
parent56a3cbc5c7fdaaa11699d2450eecfc6537911bc8 (diff)
Revert "HTTP/2 protocol handler: set the redirect URL on reply"
This reverts commit 9e268185bbb39285ee087868f9d904d7c9f6fe61. Reasons: must go into 5.9 + the logic in this patch needs fixing, not good as it is now. Change-Id: I92516ddb1d2661d85ce77c54a1307f45df1ab635 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qhttp2protocolhandler.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp
index cf1be28337..5032f6017f 100644
--- a/src/network/access/qhttp2protocolhandler.cpp
+++ b/src/network/access/qhttp2protocolhandler.cpp
@@ -1042,18 +1042,12 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const HPack::HttpHeader
}
const auto httpReplyPrivate = httpReply->d_func();
- int statusCode = 0;
for (const auto &pair : headers) {
const auto &name = pair.name;
auto value = pair.value;
if (name == ":status") {
- // TODO: part of this code copies what SPDY does when processing
- // headers. It would be nice to re-factor HTTP/2 protocol handler
- // to make it more strict in extracting things. For example, the
- // status code below ... yeah, should be an integer, right?
- statusCode = value.left(3).toInt();
- httpReply->setStatusCode(statusCode);
+ httpReply->setStatusCode(value.left(3).toInt());
httpReplyPrivate->reasonPhrase = QString::fromLatin1(value.mid(4));
} else if (name == ":version") {
httpReplyPrivate->majorVersion = value.at(5) - '0';
@@ -1064,17 +1058,6 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const HPack::HttpHeader
if (ok)
httpReply->setContentLength(length);
} else {
- if (statusCode > 300 && statusCode <= 308 && name == "location") {
- // For HTTP/1 'location' is handled (and redirect URL set) when
- // a protocol handler emits channel->allDone(). Http/2 protocol
- // handler never emits allDone, since we have many requests
- // multiplexed in one channel at any moment and we are never
- // done :) So it's time to extract location.
- const QUrl redirectUrl(QUrl::fromEncoded(value));
- if (redirectUrl.isValid())
- httpReply->setRedirectUrl(redirectUrl);
- }
-
QByteArray binder(", ");
if (name == "set-cookie")
binder = "\n";