diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-12 14:20:28 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-12 14:52:48 (GMT) |
commit | 589568759b074dd0478615f785a2297a1800d79f (patch) | |
tree | 5be4fcf0b5400c225eecfac01545da30029d8a35 /src/network | |
parent | 4f7ebc24de5496c468e38b36aaba3ad3d877198a (diff) | |
download | Qt-589568759b074dd0478615f785a2297a1800d79f.zip Qt-589568759b074dd0478615f785a2297a1800d79f.tar.gz Qt-589568759b074dd0478615f785a2297a1800d79f.tar.bz2 |
Fix an issue with HTTP headers like "private, max-age=300".
The parsing would ignore the fact that "private" ended at the comma
and would instead try to get the continuation as the value.
We have to check if equal < comma and it's not -1. Using unsigned
comparisons does both things at once for us.
Task-number: QTBUG-7060
Reviewed-by: Peter Hartmann
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qnetworkaccesshttpbackend.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index a639e0d..58123b2 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -144,7 +144,7 @@ static QHash<QByteArray, QByteArray> parseHttpOptionHeader(const QByteArray &hea QByteArray key = QByteArray(header.constData() + pos, end - pos).trimmed().toLower(); pos = end + 1; - if (equal != -1) { + if (uint(equal) < uint(comma)) { // case: token "=" (token | quoted-string) // skip spaces pos = nextNonWhitespace(header, pos); |