зеркало из https://github.com/mozilla/gecko-dev.git
Bug 826798 - Network inspector does not correctly render cookie; r=past
This commit is contained in:
Родитель
78d1ce6a1f
Коммит
eeebd2339b
|
@ -290,7 +290,9 @@ this.NetworkHelper =
|
|||
let result = [];
|
||||
|
||||
cookies.forEach(function(aCookie) {
|
||||
let [name, value] = aCookie.split("=");
|
||||
let equal = aCookie.indexOf("=");
|
||||
let name = aCookie.substr(0, equal);
|
||||
let value = aCookie.substr(equal + 1);
|
||||
result.push({name: unescape(name.trim()),
|
||||
value: unescape(value.trim())});
|
||||
});
|
||||
|
@ -314,8 +316,9 @@ this.NetworkHelper =
|
|||
let cookies = [];
|
||||
|
||||
rawCookies.forEach(function(aCookie) {
|
||||
let name = unescape(aCookie.substr(0, aCookie.indexOf("=")).trim());
|
||||
let parts = aCookie.substr(aCookie.indexOf("=") + 1).split(";");
|
||||
let equal = aCookie.indexOf("=");
|
||||
let name = unescape(aCookie.substr(0, equal).trim());
|
||||
let parts = aCookie.substr(equal + 1).split(";");
|
||||
let value = unescape(parts.shift().trim());
|
||||
|
||||
let cookie = {name: name, value: value};
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
document.cookie = "foobar=fooval";
|
||||
document.cookie = "omgfoo=bug768096";
|
||||
document.cookie = "badcookie=bug826798=st3fan";
|
||||
// --></script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -74,7 +74,7 @@ function onNetworkEventUpdate(aState, aType, aPacket)
|
|||
break;
|
||||
case "requestCookies":
|
||||
expectedPacket = {
|
||||
cookies: 2,
|
||||
cookies: 3,
|
||||
};
|
||||
break;
|
||||
case "requestPostData":
|
||||
|
@ -151,11 +151,12 @@ function onRequestCookies(aState, aResponse)
|
|||
{
|
||||
info("checking request cookies");
|
||||
|
||||
is(aResponse.cookies.length, 2, "request cookies length");
|
||||
is(aResponse.cookies.length, 3, "request cookies length");
|
||||
|
||||
checkHeadersOrCookies(aResponse.cookies, {
|
||||
foobar: "fooval",
|
||||
omgfoo: "bug768096",
|
||||
badcookie: "bug826798=st3fan",
|
||||
});
|
||||
|
||||
onRequestPostData = onRequestPostData.bind(null, aState);
|
||||
|
|
|
@ -96,7 +96,7 @@ function onNetworkEventUpdate(aState, aType, aPacket)
|
|||
break;
|
||||
case "requestCookies":
|
||||
expectedPacket = {
|
||||
cookies: 2,
|
||||
cookies: 3,
|
||||
};
|
||||
break;
|
||||
case "requestPostData":
|
||||
|
@ -174,11 +174,12 @@ function onRequestCookies(aState, aResponse)
|
|||
{
|
||||
info("checking request cookies");
|
||||
|
||||
is(aResponse.cookies.length, 2, "request cookies length");
|
||||
is(aResponse.cookies.length, 3, "request cookies length");
|
||||
|
||||
checkHeadersOrCookies(aResponse.cookies, {
|
||||
foobar: "fooval",
|
||||
omgfoo: "bug768096",
|
||||
badcookie: "bug826798=st3fan",
|
||||
});
|
||||
|
||||
onRequestPostData = onRequestPostData.bind(null, aState);
|
||||
|
|
|
@ -89,7 +89,7 @@ function onNetworkEventUpdate(aState, aType, aPacket)
|
|||
break;
|
||||
case "requestCookies":
|
||||
expectedPacket = {
|
||||
cookies: 2,
|
||||
cookies: 3,
|
||||
};
|
||||
break;
|
||||
case "requestPostData":
|
||||
|
@ -167,11 +167,12 @@ function onRequestCookies(aState, aResponse)
|
|||
{
|
||||
info("checking request cookies");
|
||||
|
||||
is(aResponse.cookies.length, 2, "request cookies length");
|
||||
is(aResponse.cookies.length, 3, "request cookies length");
|
||||
|
||||
checkHeadersOrCookies(aResponse.cookies, {
|
||||
foobar: "fooval",
|
||||
omgfoo: "bug768096",
|
||||
badcookie: "bug826798=st3fan",
|
||||
});
|
||||
|
||||
onRequestPostData = onRequestPostData.bind(null, aState);
|
||||
|
|
Загрузка…
Ссылка в новой задаче