Fix fast/forms/form-post-urlencoded.html.
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2008 10:53:45 +0000 (10:53 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2008 10:53:45 +0000 (10:53 +0000)
Post requests on files don't really make sense, but for
fast/forms/form-post-urlencoded.html we still need to retrieve the file,
which means we map it to a Get instead.

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

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

index 1026937..fce568e 100644 (file)
@@ -2,6 +2,20 @@
 
         Reviewed by Holger.
 
 
         Reviewed by Holger.
 
+        Fix fast/forms/form-post-urlencoded.html.
+        
+        Post requests on files don't really make sense, but for
+        fast/forms/form-post-urlencoded.html we still need to retrieve the file,
+        which means we map it to a Get instead.
+        
+
+        * platform/network/qt/QNetworkReplyHandler.cpp:
+        (WebCore::QNetworkReplyHandler::start):
+
+2008-01-18  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Holger.
+
         Make QNetworkReplyHandler::abort() more robust against multiple invocations.
 
         During DRT runs I see cancel() being called on the same handle multiple times. Guard
         Make QNetworkReplyHandler::abort() more robust against multiple invocations.
 
         During DRT runs I see cancel() being called on the same handle multiple times. Guard
index 9662efd..1719b2c 100644 (file)
@@ -183,6 +183,13 @@ void QNetworkReplyHandler::start()
 
     QNetworkAccessManager* manager = d->m_frame->page()->networkAccessManager();
 
 
     QNetworkAccessManager* manager = d->m_frame->page()->networkAccessManager();
 
+    // Post requests on files don't really make sense, but for
+    // fast/forms/form-post-urlencoded.html we still need to retrieve the file,
+    // which means we map it to a Get instead.
+    if (m_method == QNetworkAccessManager::PostOperation
+        && !m_request.url().toLocalFile().isEmpty())
+        m_method = QNetworkAccessManager::GetOperation;
+
     switch (m_method) {
         case QNetworkAccessManager::GetOperation:
             m_reply = manager->get(m_request);
     switch (m_method) {
         case QNetworkAccessManager::GetOperation:
             m_reply = manager->get(m_request);