Skip to content

Commit fa027e2

Browse files
committed
[mv3] Fix test for header matching when using negated value
Related commit: 09e46b744e
1 parent c6009a7 commit fa027e2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

platform/mv3/extension/js/ubo-parser.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,19 @@ export function parseNetworkFilter(parser) {
389389
}
390390
case sfp.NODE_TYPE_NET_OPTION_NAME_RESPONSEHEADER: {
391391
const details = sfp.parseHeaderValue(parser.getNetOptionValue(type));
392+
if ( details.bad ) { return; }
392393
const headerInfo = {
393394
header: details.name,
394395
};
395396
if ( details.value !== '' ) {
396397
if ( details.isRegex ) { return; }
397398
headerInfo.values = [ details.value ];
398399
}
399-
rule.condition.responseHeaders = [ headerInfo ];
400+
if ( details.not ) {
401+
rule.condition.excludedResponseHeaders = [ headerInfo ];
402+
} else {
403+
rule.condition.responseHeaders = [ headerInfo ];
404+
}
400405
break;
401406
}
402407
case sfp.NODE_TYPE_NET_OPTION_NAME_IMAGE:

0 commit comments

Comments
 (0)