In QWebPage::open(const QUrl &, const QHttpRequestHeader &, ...) don't make the popul...
authorhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2007 13:04:40 +0000 (13:04 +0000)
committerhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2007 13:04:40 +0000 (13:04 +0000)
of the WebCore::ResourceRequest depend on the validity of the QHttpRequestHeader but just
pick the individual fields if we can use them.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23496 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitQt/Api/qwebpage.cpp
WebKitQt/ChangeLog

index c34857c08c42c26ced9b6e26cb397ed1ee26c46a..78e8140326bd557f7e20c28f6824b19d0bd4cbe0 100644 (file)
@@ -139,16 +139,16 @@ void QWebPage::open(const QUrl &url, const QHttpRequestHeader &httpHeader, const
     d->insideOpenCall = true;
     WebCore::ResourceRequest request(KURL(url.toString()));
 
-    if (httpHeader.isValid()) {
-        request.setHTTPMethod(httpHeader.method());
-        foreach (QString key, httpHeader.keys()) {
-            request.addHTTPHeaderField(key, httpHeader.value(key));
-        }
-
-        if (!postData.isEmpty()) {
-            WTF::RefPtr<WebCore::FormData> formData = new WebCore::FormData(postData.constData(), postData.size());
-            request.setHTTPBody(formData);
-        }
+    QString method = httpHeader.method();
+    if (!method.isEmpty())
+        request.setHTTPMethod(method);
+
+    foreach (QString key, httpHeader.keys())
+        request.addHTTPHeaderField(key, httpHeader.value(key));
+
+    if (!postData.isEmpty()) {
+        WTF::RefPtr<WebCore::FormData> formData = new WebCore::FormData(postData.constData(), postData.size());
+        request.setHTTPBody(formData);
     }
 
     mainFrame()->d->frame->loader()->load(request);
index cf97bf6b4e17560456db3f1bdb88fcb2912faff1..a66f85616beebf44f74199835c2b841a329db530 100644 (file)
@@ -1,3 +1,14 @@
+2007-06-13  Simon Hausmann  <hausmann@kde.org>
+
+        Reviewed by Lars.
+
+        In QWebPage::open(const QUrl &, const QHttpRequestHeader &, ...) don't make the population
+        of the WebCore::ResourceRequest depend on the validity of the QHttpRequestHeader but just
+        pick the individual fields if we can use them.
+
+        * Api/qwebpage.cpp:
+        (QWebPage::open):
+
 2007-06-13  Simon Hausmann  <hausmann@kde.org>
 
         Reviewed by Lars.