summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkrequest.cpp
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2010-11-18 01:19:33 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-11-18 01:19:33 (GMT)
commit051793b7558ed16dfcb84f62ce3bd4a1545906a7 (patch)
tree2496fdaec40857e9982c93d18107e09e233145d4 /src/network/access/qnetworkrequest.cpp
parent14ddf44ce2fdd7195741b9683226a3cd774e17e4 (diff)
parentcca7c5b40751e2192ba2c7c7422557eeb5672a17 (diff)
downloadQt-051793b7558ed16dfcb84f62ce3bd4a1545906a7.zip
Qt-051793b7558ed16dfcb84f62ce3bd4a1545906a7.tar.gz
Qt-051793b7558ed16dfcb84f62ce3bd4a1545906a7.tar.bz2
Merge remote branch 'qt/4.7' into 4.7
Conflicts: tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt.qdocconf
Diffstat (limited to 'src/network/access/qnetworkrequest.cpp')
-rw-r--r--src/network/access/qnetworkrequest.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index b761af5..162392d 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -899,10 +899,16 @@ void QNetworkHeadersPrivate::parseAndSetHeader(const QByteArray &key, const QByt
// is it a known header?
QNetworkRequest::KnownHeaders parsedKey = parseHeaderName(key);
if (parsedKey != QNetworkRequest::KnownHeaders(-1)) {
- if (value.isNull())
+ if (value.isNull()) {
cookedHeaders.remove(parsedKey);
- else
+ } else if (parsedKey == QNetworkRequest::ContentLengthHeader
+ && cookedHeaders.contains(QNetworkRequest::ContentLengthHeader)) {
+ // Only set the cooked header "Content-Length" once.
+ // See bug QTBUG-15311
+ } else {
cookedHeaders.insert(parsedKey, parseHeaderValue(parsedKey, value));
+ }
+
}
}