diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qnetworkcookie.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index 0670738..a9bb318 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -372,7 +372,7 @@ static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &posi // parse the first part, before the equal sign for (i = position; i < length; ++i) { register char c = text.at(i); - if (c == ';' || c == ',' || c == '=') + if (c == ';' || c == '=') break; } @@ -423,7 +423,7 @@ static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &posi for ( ; i < length; ++i) { register char c = text.at(i); - if (c == ',' || c == ';') + if (c == ';') break; } position = i; @@ -434,7 +434,7 @@ static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &posi register char c = text.at(i); // 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)))) + if (c == ';' || ((isNameValue && (c == '\n' || c == '\r')) || (!isNameValue && isLWS(c)))) break; } @@ -461,8 +461,7 @@ static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &posi \value Full makes toRawForm() return the full cookie contents, as suitable for sending to a client in a - server's "Set-Cookie:" header. Multiple cookies are separated - by commas in a "Set-Cookie:" header. + server's "Set-Cookie:" header. Note that only the Full form of the cookie can be parsed back into its original contents. @@ -488,7 +487,6 @@ QByteArray QNetworkCookie::toRawForm(RawForm form) const result = d->name; result += '='; if ((d->value.contains(';') || - d->value.contains(',') || d->value.contains('"')) && (!d->value.startsWith('"') && !d->value.endsWith('"'))) { @@ -967,14 +965,8 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt cookie.setValue(field.second); position = nextNonWhitespace(cookieString, position); - bool endOfCookie = false; - while (!endOfCookie && position < length) { + while (position < length) { switch (cookieString.at(position++)) { - case ',': - // end of the cookie - endOfCookie = true; - break; - case ';': // new field in the cookie field = nextField(cookieString, position, false); |