From 231259c3d519a55880563b12f5796723fa99e522 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 2 Jan 2017 15:47:15 +0100 Subject: Add a user-controlled auto-redirect policy With this new policy, after emitting 'redirected', QNetworkReplyHttpImpl waits for client code to decide if QNAM should follow this redirect or not. The client can either allow this redirect by emitting 'redirectAllowed' or abort the reply. Task-number: QTPM-236 Change-Id: Ia04619f6bd1f0caa477833ae859b24033027b2e1 Reviewed-by: Timur Pocheptsov Reviewed-by: Edward Welbourne --- src/network/access/qnetworkreplyhttpimpl_p.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/network/access/qnetworkreplyhttpimpl_p.h') diff --git a/src/network/access/qnetworkreplyhttpimpl_p.h b/src/network/access/qnetworkreplyhttpimpl_p.h index 255c23006e..9383149124 100644 --- a/src/network/access/qnetworkreplyhttpimpl_p.h +++ b/src/network/access/qnetworkreplyhttpimpl_p.h @@ -136,6 +136,7 @@ public: Q_PRIVATE_SLOT(d_func(), void _q_cacheSaveDeviceAboutToClose()) Q_PRIVATE_SLOT(d_func(), void _q_metaDataChanged()) Q_PRIVATE_SLOT(d_func(), void onRedirected(const QUrl &, int, int)) + Q_PRIVATE_SLOT(d_func(), void followRedirect()) #ifndef QT_NO_SSL protected: @@ -212,6 +213,7 @@ public: QSharedPointer outgoingDataBuffer; void emitReplyUploadProgress(qint64 bytesSent, qint64 bytesTotal); // dup? void onRedirected(const QUrl &redirectUrl, int httpStatus, int maxRedirectsRemainig); + void followRedirect(); qint64 bytesUploaded; @@ -263,6 +265,7 @@ public: QList pendingIgnoreSslErrorsList; #endif + QNetworkRequest redirectRequest; bool loadFromCacheIfAllowed(QHttpNetworkRequest &httpRequest); void invalidateCache(); -- cgit v1.2.3