зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1354508 - Add filter option for network requests checking for a specific response header. r=ntim
MozReview-Commit-ID: E5wm5BgDJNU --HG-- extra : rebase_source : ba4b21b7b53fa1f676d132f57556e86ff6fb163a
This commit is contained in:
Родитель
dbbda3c4ba
Коммит
af4bce1bae
|
@ -41,6 +41,7 @@ const FILTER_FLAGS = [
|
||||||
"mime-type",
|
"mime-type",
|
||||||
"larger-than",
|
"larger-than",
|
||||||
"is",
|
"is",
|
||||||
|
"has-response-header",
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -133,6 +134,14 @@ function isFlagFilterMatch(item, { type, value, negative }) {
|
||||||
case "remote-ip":
|
case "remote-ip":
|
||||||
match = `${item.remoteAddress}:${item.remotePort}`.toLowerCase().includes(value);
|
match = `${item.remoteAddress}:${item.remotePort}`.toLowerCase().includes(value);
|
||||||
break;
|
break;
|
||||||
|
case "has-response-header":
|
||||||
|
if (typeof item.responseHeaders === "object") {
|
||||||
|
let { headers } = item.responseHeaders;
|
||||||
|
match = headers.findIndex(h => h.name.toLowerCase() === value) > -1;
|
||||||
|
} else {
|
||||||
|
match = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "cause":
|
case "cause":
|
||||||
let causeType = item.cause.type;
|
let causeType = item.cause.type;
|
||||||
match = typeof causeType === "string" ?
|
match = typeof causeType === "string" ?
|
||||||
|
|
Загрузка…
Ссылка в новой задаче