Browse Source

AbstractNetworkJob: Allow relative redirect

Previously all redirects were considered absolute.
Christian Kamm 8 years ago
parent
commit
be5d5aea6d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/libsync/abstractnetworkjob.cpp

+ 4 - 0
src/libsync/abstractnetworkjob.cpp

@@ -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