[Pkg-kde-commits] rev 465 - in trunk/packages/kdelibs/debian: . patches

Adeodato Simó dato-guest@costa.debian.org
Sun, 13 Feb 2005 05:06:31 +0100


Author: dato-guest
Date: 2005-02-13 05:06:30 +0100 (Sun, 13 Feb 2005)
New Revision: 465

Added:
   trunk/packages/kdelibs/debian/patches/17_XMLHttpRequest_POST_fix.diff
Modified:
   trunk/packages/kdelibs/debian/changelog
Log:
patches/17_XMLHttpRequest_POST_fix.diff:
  * Include patch from CVS to fix XMLHttpRequest POST being broken in KHTML
    due to a blank line in headers. (Closes: #292765)



Modified: trunk/packages/kdelibs/debian/changelog
===================================================================
--- trunk/packages/kdelibs/debian/changelog	2005-02-13 03:59:03 UTC (rev 464)
+++ trunk/packages/kdelibs/debian/changelog	2005-02-13 04:06:30 UTC (rev 465)
@@ -9,6 +9,9 @@
 
   * KDE_3_3_BRANCH update.
 
+  * Include patch from CVS to fix XMLHttpRequest POST being broken in KHTML
+    due to a blank line in headers. (Closes: #292765)
+
   +++ Changes by Christopher Martin:
 
   * Add patch from upstream that solves the problem wherein programs whose

Added: trunk/packages/kdelibs/debian/patches/17_XMLHttpRequest_POST_fix.diff
===================================================================
--- trunk/packages/kdelibs/debian/patches/17_XMLHttpRequest_POST_fix.diff	2005-02-13 03:59:03 UTC (rev 464)
+++ trunk/packages/kdelibs/debian/patches/17_XMLHttpRequest_POST_fix.diff	2005-02-13 04:06:30 UTC (rev 465)
@@ -0,0 +1,63 @@
+Index: kdelibs/khtml/ecma/xmlhttprequest.h
+===================================================================
+RCS file: /home/kde/kdelibs/khtml/ecma/xmlhttprequest.h,v
+retrieving revision 1.5
+retrieving revision 1.6
+diff -u -p -r1.5 -r1.6
+--- kdelibs/khtml/ecma/xmlhttprequest.h	11 Nov 2004 04:34:28 -0000	1.5
++++ kdelibs/khtml/ecma/xmlhttprequest.h	26 Jan 2005 09:05:10 -0000	1.6
+@@ -98,6 +98,7 @@ namespace KJS {
+     QString method;
+     bool async;
+     QString requestHeaders;
++    QString contentType;
+ 
+     KIO::TransferJob * job;
+ 
+Index: kdelibs/khtml/ecma/xmlhttprequest.cpp
+===================================================================
+RCS file: /home/kde/kdelibs/khtml/ecma/xmlhttprequest.cpp,v
+retrieving revision 1.10
+retrieving revision 1.11
+diff -u -p -r1.10 -r1.11
+--- kdelibs/khtml/ecma/xmlhttprequest.cpp	8 Dec 2004 01:32:46 -0000	1.10
++++ kdelibs/khtml/ecma/xmlhttprequest.cpp	26 Jan 2005 09:05:10 -0000	1.11
+@@ -110,6 +110,7 @@ Object XMLHttpRequestConstructorImp::con
+ 
+ const ClassInfo XMLHttpRequest::info = { "XMLHttpRequest", 0, &XMLHttpRequestTable, 0 };
+ 
++
+ /* Source for XMLHttpRequestTable.
+ @begin XMLHttpRequestTable 7
+   readyState		XMLHttpRequest::ReadyState		DontDelete|ReadOnly
+@@ -216,6 +217,7 @@ XMLHttpRequest::XMLHttpRequest(ExecState
+     qObject(new XMLHttpRequestQObject(this)),
+     doc(static_cast<DOM::DocumentImpl*>(d.handle())),
+     async(true),
++    contentType(QString::null),
+     job(0),
+     state(Uninitialized),
+     onReadyStateChangeListener(0),
+@@ -308,6 +310,10 @@ void XMLHttpRequest::send(const QString&
+   if (method.lower() == "post" && (url.protocol().lower() == "http" || url.protocol().lower() == "https") ) {
+       // FIXME: determine post encoding correctly by looking in headers for charset
+       job = KIO::http_post( url, QCString(_body.utf8()), false );
++      if(contentType.isNull())
++	job->addMetaData( "content-type", "Content-type: text/plain" );
++      else
++	job->addMetaData( "content-type", contentType );
+   }
+   else
+   {
+@@ -368,6 +374,11 @@ void XMLHttpRequest::abort()
+ 
+ void XMLHttpRequest::setRequestHeader(const QString& name, const QString &value)
+ {
++  // Content-type needs to be set seperately from the other headers
++  if(name.lower() == "content-type") {
++    contentType = "Content-type: " + value;
++    return;
++  }
+   if (requestHeaders.length() > 0) {
+     requestHeaders += "\r\n";
+   }