Reviewed by Eric Seidel.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Dec 2005 08:55:02 +0000 (08:55 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Dec 2005 08:55:02 +0000 (08:55 +0000)
        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5924
          Zero-length responses to XMLHTTPRequest mishandled

        * khtml/ecma/xmlhttprequest.cpp (KJS::XMLHttpRequest::slotFinished):
          Make sure to fetch response headers and set the state to Loaded, if
          this hasn't been done already.

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

WebCore/ChangeLog
WebCore/khtml/ecma/xmlhttprequest.cpp

index 26b9aeee142e5e7a76cb40479d8c5754806828f1..901559cb018f2ddc72c603b60e04aaf24f9a02af 100644 (file)
@@ -1,3 +1,14 @@
+2005-12-23  Alexey Proskuryakov  <ap@nypop.com>
+
+        Reviewed by Eric Seidel.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5924
+          Zero-length responses to XMLHTTPRequest mishandled
+
+        * khtml/ecma/xmlhttprequest.cpp (KJS::XMLHttpRequest::slotFinished):
+          Make sure to fetch response headers and set the state to Loaded, if
+          this hasn't been done already.
+
 2005-12-23  Alexey Proskuryakov  <ap@nypop.com>
 
         Reviewed by Eric Seidel.
 2005-12-23  Alexey Proskuryakov  <ap@nypop.com>
 
         Reviewed by Eric Seidel.
index 8d0f61f80d748ea6d5f5edcf67730dcf3b3db2d6..e309a5f281e9830e69ee33b8ed4eef2cf43157e8 100644 (file)
@@ -576,6 +576,12 @@ void XMLHttpRequest::processSyncLoadResults(const QByteArray &data, const KURL &
 
 void XMLHttpRequest::slotFinished(KIO::Job *)
 {
 
 void XMLHttpRequest::slotFinished(KIO::Job *)
 {
+  if (responseHeaders.isEmpty() && job)
+    responseHeaders = job->queryMetaData("HTTP-Headers");
+
+  if (state < Loaded)
+    changeState(Loaded);
+
   if (decoder)
     response += decoder->flush();
 
   if (decoder)
     response += decoder->flush();