AbstractNetworkJob: Allow relative redirect
authorChristian Kamm <mail@ckamm.de>
Fri, 15 Sep 2017 07:24:56 +0000 (09:24 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 5 Oct 2017 20:01:32 +0000 (22:01 +0200)
Previously all redirects were considered absolute.

src/libsync/abstractnetworkjob.cpp

index de68182ef08deaeaab1f76a3612d6bd905ce0bd5..f5f4b9d6251bb415138f249deff1f22cb24ef0eb 100644 (file)
@@ -173,6 +173,10 @@ void AbstractNetworkJob::slotFinished()
     if (_followRedirects && !redirectUrl.isEmpty()) {
         _redirectCount++;
 
+        // Redirects may be relative
+        if (redirectUrl.isRelative())
+            redirectUrl = requestedUrl.resolved(redirectUrl);
+
         // For POST requests where the target url has query arguments, Qt automatically
         // moves these arguments to the body if no explicit body is specified.
         // This can cause problems with redirected requests, because the redirect url