summaryrefslogtreecommitdiffstats
path: root/nsplugins/viewer
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-26 18:42:45 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-26 18:42:45 +0000
commit830032294517ab286b424639fcf65435826d42c3 (patch)
tree17c2823a41d7bb1b4a60f879709bb8faeeb7dd05 /nsplugins/viewer
parent5724164fa199cbdd4b7c736ef5153836d7a847d7 (diff)
downloadtdebase-830032294517ab286b424639fcf65435826d42c3.tar.gz
tdebase-830032294517ab286b424639fcf65435826d42c3.zip
Implement NSAPI RESPONSE_HEADERS in nsplugin.
Cherry picked from KDE4, acknowledgements to Maksim Orlovich for the fix, and to Nick Leverton for the TDE backport. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1255714 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'nsplugins/viewer')
-rw-r--r--nsplugins/viewer/nsplugin.cpp11
-rw-r--r--nsplugins/viewer/nsplugin.h1
2 files changed, 8 insertions, 4 deletions
diff --git a/nsplugins/viewer/nsplugin.cpp b/nsplugins/viewer/nsplugin.cpp
index fe2dabfbf..0f56f055f 100644
--- a/nsplugins/viewer/nsplugin.cpp
+++ b/nsplugins/viewer/nsplugin.cpp
@@ -1674,6 +1674,7 @@ bool NSPluginStreamBase::create( const TQString& url, const TQString& mimeType,
_stream->pdata = 0;
_stream->lastmodified = 0;
_stream->notifyData = _notifyData;
+ _stream->headers = 0;
_mimeType = mimeType;
@@ -1898,6 +1899,7 @@ bool NSPluginStream::get( const TQString& url, const TQString& mimeType,
_job = KIO::get(KURL( url ), false, false);
_job->addMetaData("errorPage", "false");
_job->addMetaData("AllowCompressedPage", "false");
+ _job->addMetaData("PropagateHttpHeader", "true");
if (reload) {
_job->addMetaData("cache", "reload");
}
@@ -1925,6 +1927,7 @@ bool NSPluginStream::post( const TQString& url, const TQByteArray& data,
_job = KIO::http_post(KURL( url ), data, false);
_job->addMetaData("content-type", args.contentType());
_job->addMetaData("errorPage", "false");
+ _job->addMetaData("PropagateHttpHeader", "true");
_job->addMetaData("AllowCompressedPage", "false");
connect(_job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)),
TQT_SLOT(data(KIO::Job *, const TQByteArray &)));
@@ -1964,13 +1967,13 @@ void NSPluginStream::totalSize(KIO::Job * job, KIO::filesize_t size)
void NSPluginStream::mimetype(KIO::Job * job, const TQString &mimeType)
{
- kdDebug(1431) << "NSPluginStream::TQByteArray - job=" << (void*)job << " mimeType=" << mimeType << endl;
+ kdDebug(1431) << "NSPluginStream::mimetype - job=" << (void*)job << " mimeType=" << mimeType << endl;
_mimeType = mimeType;
+ TQString tmp_headers = job->metaData()["HTTP-Headers"];
+ _headers.duplicate(tmp_headers.latin1(), tmp_headers.length());
+ _stream->headers = _headers.data();
}
-
-
-
void NSPluginStream::resume()
{
if ( error() || tries()>8 ) {
diff --git a/nsplugins/viewer/nsplugin.h b/nsplugins/viewer/nsplugin.h
index 1c241cc8e..2a2af35d5 100644
--- a/nsplugins/viewer/nsplugin.h
+++ b/nsplugins/viewer/nsplugin.h
@@ -95,6 +95,7 @@ protected:
KURL _url;
TQString _fileURL;
TQString _mimeType;
+ TQByteArray _headers;
TQByteArray _data;
class KTempFile *_tempFile;