BHttpRequest: More elegant way to build cookieString
This commit is contained in:
@@ -937,13 +937,11 @@ BHttpRequest::_SendHeaders()
|
|||||||
for (BNetworkCookieJar::UrlIterator it
|
for (BNetworkCookieJar::UrlIterator it
|
||||||
= fContext->GetCookieJar().GetUrlIterator(fUrl);
|
= fContext->GetCookieJar().GetUrlIterator(fUrl);
|
||||||
(cookie = it.Next()) != NULL;) {
|
(cookie = it.Next()) != NULL;) {
|
||||||
cookieString << cookie->RawCookie(false);
|
if (cookieString.Length() > 0)
|
||||||
cookieString << "; ";
|
cookieString << "; ";
|
||||||
|
cookieString << cookie->RawCookie(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the extra "; " we added after the last item.
|
|
||||||
cookieString.Truncate(cookieString.Length() - 2);
|
|
||||||
|
|
||||||
if (cookieString.Length() > 0)
|
if (cookieString.Length() > 0)
|
||||||
fOutputHeaders.AddHeader("Cookie", cookieString);
|
fOutputHeaders.AddHeader("Cookie", cookieString);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user