Fix fast/forms/button-state-restore.html
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2008 10:55:39 +0000 (10:55 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2008 10:55:39 +0000 (10:55 +0000)
Similar to the fix for fast/forms/form-post-urlencoded.html transform POST
requests to data urls into GET.

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

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

index e1ffe10..8f755f4 100644 (file)
@@ -2,6 +2,19 @@
 
         Reviewed by Holger.
 
+        Fix fast/forms/button-state-restore.html
+        
+        Similar to the fix for fast/forms/form-post-urlencoded.html transform POST
+        requests to data urls into GET.
+        
+
+        * platform/network/qt/QNetworkReplyHandler.cpp:
+        (WebCore::QNetworkReplyHandler::start):
+
+2008-01-18  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Holger.
+
         Fix LayoutTests/fast/cookies/local-file-can-set-cookies.html
         
         In WebCore::cookies() don't return the full raw form but only the name=value
index 73b5024..05512e0 100644 (file)
@@ -193,11 +193,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.
+    const QUrl url = m_request.url();
+    const QString scheme = url.scheme();
+    // Post requests on files and data don't really make sense, but for
+    // fast/forms/form-post-urlencoded.html and for fast/forms/button-state-restore.html
+    // we still need to retrieve the file/data, which means we map it to a Get instead.
     if (m_method == QNetworkAccessManager::PostOperation
-        && !m_request.url().toLocalFile().isEmpty())
+        && (!url.toLocalFile().isEmpty() || url.scheme() == QLatin1String("data")))
         m_method = QNetworkAccessManager::GetOperation;
 
     switch (m_method) {
@@ -233,7 +235,6 @@ void QNetworkReplyHandler::start()
 
     // For http(s) we know that the headers are complete upon metaDataChanged() emission, so we
     // can send the response as early as possible
-    QString scheme = m_request.url().scheme();
     if (scheme == QLatin1String("http") || scheme == QLatin1String("https"))
         connect(m_reply, SIGNAL(metaDataChanged()),
                 this, SLOT(sendResponseIfNeeded()));