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:
Vangelis Katsikaros 2017-04-13 22:59:21 +03:00
Родитель dbbda3c4ba
Коммит af4bce1bae
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -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" ?