Make redirects work.
authorstaikos <staikos@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Dec 2006 05:50:43 +0000 (05:50 +0000)
committerstaikos <staikos@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Dec 2006 05:50:43 +0000 (05:50 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18467 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/network/qt/ResourceHandleManagerQt.cpp

index fafe5a303c9d98f3c0fd9a6e2ee09f5a7bc93157..c0f54174f7f8449d0d24de8419786e802d928b7f 100644 (file)
@@ -1,3 +1,12 @@
+2006-12-29  George Staikos  <staikos@kde.org>
+
+        Reviewed by Olliej.
+
+        Make redirects work properly.  Sites will thank us for this. :-)
+
+        * platform/network/qt/ResourceHandleManagerQt.cpp:
+        (WebCore::ResourceHandleManager::receivedResponse):
+
 2006-12-28  George Staikos  <staikos@kde.org>
 
         Reviewed by Olliej.
index c97f5cf306eaa77fdeb49751bcc0ef17dc08772a..42d37591d546e6274eae5cea24ce1963fff56c67 100644 (file)
@@ -238,8 +238,13 @@ void ResourceHandleManager::receivedResponse(RequestQt* request)
             ResourceRequest newRequest = request->resource->request();
             newRequest.setURL(DeprecatedString(location));
             client->willSendRequest(request->resource, newRequest, response);
-            request->request.setRequest(request->request.method(), newRequest.url().path());
+            request->request.setRequest(request->request.method(), newRequest.url().path() + newRequest.url().query());
             request->url = newRequest.url();
+            int port = request->url.port();
+            if (port && port != 80)
+                request->request.setValue(QLatin1String("Host"), request->url.host() + QLatin1Char(':') + QString::number(port));
+            else
+                request->request.setValue(QLatin1String("Host"), request->url.host());
             request->redirected = true;
             return;
         }