diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2017-01-02 15:47:15 +0100 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2017-01-19 04:34:03 +0000 |
commit | 231259c3d519a55880563b12f5796723fa99e522 (patch) | |
tree | aea3205f73e08803a7d52cb2581cf67c4266f7bf /src/network/access/qnetworkrequest.cpp | |
parent | 45f80a52c2d01ba14f550e48e32d95748a3ff444 (diff) | |
download | qtbase-231259c3d519a55880563b12f5796723fa99e522.tar.gz |
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 <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/access/qnetworkrequest.cpp')
-rw-r--r-- | src/network/access/qnetworkrequest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index abc924d0e2..169695fa27 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -360,6 +360,16 @@ QT_BEGIN_NAMESPACE Note, http://example.com and http://example.com:80 will fail with this policy (implicit/explicit ports are considered to be a mismatch). + + \value UserVerifiedRedirectsPolicy Client decides whether to follow each + redirect by handling the redirected() + signal, emitting redirectAllowed() on + the QNetworkReply object to allow + the redirect or aborting/finishing it to + reject the redirect. This can be used, + for example, to ask the user whether to + accept the redirect, or to decide + based on some app-specific configuration. */ class QNetworkRequestPrivate: public QSharedData, public QNetworkHeadersPrivate |