diff options
Diffstat (limited to 'src/network/access/qhttpnetworkrequest.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkrequest.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/network/access/qhttpnetworkrequest.cpp b/src/network/access/qhttpnetworkrequest.cpp index 802043d847..60b566299f 100644 --- a/src/network/access/qhttpnetworkrequest.cpp +++ b/src/network/access/qhttpnetworkrequest.cpp @@ -48,7 +48,8 @@ QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(QHttpNetworkRequest::Oper QHttpNetworkRequest::Priority pri, const QUrl &newUrl) : QHttpNetworkHeaderPrivate(newUrl), operation(op), priority(pri), uploadByteDevice(0), autoDecompress(false), pipeliningAllowed(false), spdyAllowed(false), http2Allowed(false), - withCredentials(true), preConnect(false), followRedirect(false), redirectCount(0) + withCredentials(true), preConnect(false), redirectCount(0), + redirectPolicy(QNetworkRequest::ManualRedirectPolicy) { } @@ -65,8 +66,8 @@ QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(const QHttpNetworkRequest withCredentials(other.withCredentials), ssl(other.ssl), preConnect(other.preConnect), - followRedirect(other.followRedirect), - redirectCount(other.redirectCount) + redirectCount(other.redirectCount), + redirectPolicy(other.redirectPolicy) { } @@ -88,7 +89,8 @@ bool QHttpNetworkRequestPrivate::operator==(const QHttpNetworkRequestPrivate &ot && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) - && (preConnect == other.preConnect); + && (preConnect == other.preConnect) + && (redirectPolicy == other.redirectPolicy); } QByteArray QHttpNetworkRequest::methodName() const @@ -229,12 +231,17 @@ void QHttpNetworkRequest::setPreConnect(bool preConnect) bool QHttpNetworkRequest::isFollowRedirects() const { - return d->followRedirect; + return d->redirectPolicy != QNetworkRequest::ManualRedirectPolicy; } -void QHttpNetworkRequest::setFollowRedirects(bool followRedirect) +void QHttpNetworkRequest::setRedirectPolicy(QNetworkRequest::RedirectPolicy policy) { - d->followRedirect = followRedirect; + d->redirectPolicy = policy; +} + +QNetworkRequest::RedirectPolicy QHttpNetworkRequest::redirectPolicy() const +{ + return d->redirectPolicy; } int QHttpNetworkRequest::redirectCount() const |