[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdelibs/khtml/ecma
From: Stephan Kulow <coolo () kde ! org>
Date: 2005-01-26 9:05:10
Message-ID: 20050126090510.D0A2F1D1CB () office ! kde ! org
[Download RAW message or body]
CVS commit by coolo:
applying the patch as the logic seems correct to me (and Zack didn't protest)
BUG: 95981
M +11 -0 xmlhttprequest.cpp 1.11
M +1 -0 xmlhttprequest.h 1.6
--- kdelibs/khtml/ecma/xmlhttprequest.cpp #1.10:1.11
@@ -217,4 +218,5 @@ XMLHttpRequest::XMLHttpRequest(ExecState
doc(static_cast<DOM::DocumentImpl*>(d.handle())),
async(true),
+ contentType(QString::null),
job(0),
state(Uninitialized),
@@ -309,4 +311,8 @@ void XMLHttpRequest::send(const QString&
// 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
@@ -369,4 +375,9 @@ 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";
--- kdelibs/khtml/ecma/xmlhttprequest.h #1.5:1.6
@@ -99,4 +99,5 @@ namespace KJS {
bool async;
QString requestHeaders;
+ QString contentType;
KIO::TransferJob * job;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic