Open
Bug 1402043
Opened 8 years ago
Updated 3 years ago
MatchPattern subsumption checks mishandle *://
Categories
(WebExtensions :: General, enhancement, P3)
WebExtensions
General
Tracking
(firefox57 affected)
NEW
| Tracking | Status | |
|---|---|---|
| firefox57 | --- | affected |
People
(Reporter: Kwan, Unassigned)
Details
(Keywords: dev-doc-complete)
let matcher = new MatchPatternSet(["http://*.example.com/*", "https://*.example.com/*"]);
let newPerm = new MatchPattern("*://*.example.com/*");
matcher.subsumes(newPerm); // false
This should return true from reading the docs since https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Match_patterns#scheme specifies that *:// matches only http:// and https://
...however looking at the code the docs are out of date, and ws: and wss: should be listed since https://hg.mozilla.org/mozilla-central/rev/62e44a827308 and bug 1367478. Though even adjusting the code to include websockets still gives an incorrect false:
let wsMatcher = new MatchPatternSet(["http://*.example.com/*", "https://*.example.com/*", "ws://*.example.com/*", "wss://*.example.com/*"]);
wsMatcher.subsumes(newPerm); // false
overlapsAll also seems to give incorrect results:
matcher.overlapsAll(new MatchPatternSet(["*://*.example.com/*"])); // true
// should be false since matcher is missing wss?://
it's possible I'm misunderstanding the code somewhere
Comment 1•8 years ago
|
||
Looks like the docs need fixing up, added flag. ni'ing mixedpuppy for the rest.
Flags: needinfo?(mixedpuppy)
Keywords: dev-doc-needed
Updated•8 years ago
|
Priority: -- → P3
Updated•8 years ago
|
Summary: MatchPattern doesn't treat *:// as equivalent to its component protocols → MatchPattern subsumption checks mishandle *://
Comment 2•8 years ago
|
||
Pretty much as Kris updated. ws/s is somewhat of an alias to http/s, we're treating it as such for pattern matching.
Flags: needinfo?(mixedpuppy)
Updated•7 years ago
|
Product: Toolkit → WebExtensions
Comment 3•6 years ago
|
||
Looks like the docs have been fixed since then, to cover ws/wss
Keywords: dev-doc-needed → dev-doc-complete
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•