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 102693787193f182c94f8c06c0c925fa23ad4de0..fce568e47588459d2b898c65462721d6ca546b21 100644 (file)
@@ -1,3 +1,17 @@
+2008-01-18  Simon Hausmann  <hausmann@webkit.org>
+
+        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.
index 9662efd1a8f92b5775283ab0e8aaab7e27f03e6b..1719b2cf38c817724006f1a5fa387b7aebe35abd 100644 (file)
@@ -183,6 +183,13 @@ void QNetworkReplyHandler::start()
 
     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);