diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-05-04 10:41:39 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-05-04 10:41:39 (GMT) |
commit | 8a706b5133b1ba1d5eb5fdca97e002597d6ff829 (patch) | |
tree | 5cf57028938262d25ea1894784dd97289184241c /src/network/access/qnetworkcookie.cpp | |
parent | 9625c564877414695a9706acf34bc8719018ef06 (diff) | |
parent | 60e65cc23bf1df213320604062ef98e40c46d3df (diff) | |
download | Qt-8a706b5133b1ba1d5eb5fdca97e002597d6ff829.zip Qt-8a706b5133b1ba1d5eb5fdca97e002597d6ff829.tar.gz Qt-8a706b5133b1ba1d5eb5fdca97e002597d6ff829.tar.bz2 |
Merge remote-tracking branch 'origin/4.8' into lighthouse-master
Diffstat (limited to 'src/network/access/qnetworkcookie.cpp')
-rw-r--r-- | src/network/access/qnetworkcookie.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index 52eb345..eec8507 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -395,8 +395,8 @@ static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &posi // qdtext = <any TEXT except <">> // quoted-pair = "\" CHAR - // If its NAME=VALUE, retain the value as is - // refer to ttp://bugreports.qt.nokia.com/browse/QTBUG-17746 + // If it is NAME=VALUE, retain the value as is + // refer to http://bugreports.qt.nokia.com/browse/QTBUG-17746 if (isNameValue) second += '"'; ++i; @@ -432,7 +432,9 @@ static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &posi position = i; for ( ; i < length; ++i) { register char c = text.at(i); - if (c == ',' || c == ';' || isLWS(c)) + // for name value pairs, we want to parse until reaching the next ';' + // and not break when reaching a space char + if (c == ',' || c == ';' || ((isNameValue && (c == '\n' || c == '\r')) || (!isNameValue && isLWS(c)))) break; } @@ -487,7 +489,6 @@ QByteArray QNetworkCookie::toRawForm(RawForm form) const result += '='; if ((d->value.contains(';') || d->value.contains(',') || - d->value.contains(' ') || d->value.contains('"')) && (!d->value.startsWith('"') && !d->value.endsWith('"'))) { |