/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
for (DWORD i = 0; i < cookieCount; i++) {
nsAutoString cookieData;
cookieData.Assign(cookieInfo[i].data); // Strip old Set-Cookie info for WinInet
int32_t semicolon = cookieData.FindChar(';'); if (semicolon >= 0) {
cookieData.SetLength(semicolon);
} if (StringBeginsWith(nsDependentString(cookieInfo[i].name), u"x-ms-"_ns)) {
channel->SetRequestHeader(NS_ConvertUTF16toUTF8(cookieInfo[i].name),
NS_ConvertUTF16toUTF8(cookieData), true/* merge */);
} elseif (addCookies) { if (!allCookies.IsEmpty()) {
allCookies.AppendLiteral("; ");
}
allCookies.Append(cookieInfo[i].name);
allCookies.AppendLiteral("=");
allCookies.Append(cookieData);
}
}
// Merging cookie headers doesn't work correctly as it separates the new // cookies using commas instead of semicolons, so we have to replace // the entire header. if (!allCookies.IsEmpty()) {
nsAutoCString cookieHeader;
channel->GetRequestHeader(nsHttp::Cookie.val(), cookieHeader); if (!cookieHeader.IsEmpty()) {
cookieHeader.AppendLiteral("; ");
}
cookieHeader.Append(NS_ConvertUTF16toUTF8(allCookies));
channel->SetRequestHeader(nsHttp::Cookie.val(), cookieHeader, false);
} if (cookieInfo) {
FreeProofOfPossessionCookieInfoArray(cookieInfo, cookieCount);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.