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);
+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.