Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 36 additions & 55 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ tracing-subscriber = "0.3.20"
twox-hash = { version = "=2.1.0", features = ["std", "xxhash64"], default-features = false }
typed-arena = "=2.0.2"
url = { version = "2.5", features = ["serde", "expose_internals"] }
urlpattern = "0.3.0"
urlpattern = "=0.4.1"
uuid = { version = "1.3.0", features = ["v4"] }
walkdir = "=2.5.0"
weak-table = "0.3.2"
Expand Down
2 changes: 1 addition & 1 deletion ext/web/01_urlpattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class URLPattern {
input = { __proto__: null };
}
options = webidl.converters.URLPatternOptions(
maybeOptions,
baseURLOrOptions,
prefix,
"Argument 2",
);
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/urlpattern_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,13 @@ Deno.test(function urlPatternWithPrototypePollution() {
RegExp.prototype.exec = originalExec;
}
});

Deno.test(function urlPatternFlagsRegression() {
new URLPattern({ pathname: "/install(\.sh|\.ps1)" });
});

Deno.test(function urlPatternIgnoreCase() {
const p = new URLPattern({ pathname: "/test" }, { ignoreCase: true });
assert(p.test("/test", "http://localhost"));
assert(p.test("/TeSt", "http://localhost"));
});
60 changes: 0 additions & 60 deletions tests/wpt/runner/expectation.json
Original file line number Diff line number Diff line change
Expand Up @@ -15438,22 +15438,7 @@
"urlpattern.any.html": [
"Pattern: [{\"pathname\":\"\\ud83d \\udeb2\"}] Inputs: []",
"Pattern: [{\"pathname\":\":a󠄀b\"}] Inputs: []",
"Pattern: [{\"protocol\":\"http\",\"port\":\"80 \"}] Inputs: [{\"protocol\":\"http\",\"port\":\"80\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"8\\t0\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"80x\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"80?x\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"80\\\\x\"}]",
"Pattern: [\"https://{sub.}?example{.com/}foo\"] Inputs: [\"https://example.com/foo\"]",
"Pattern: [{\"hostname\":\"bad#hostname\"}] Inputs: [{\"hostname\":\"bad\"}]",
"Pattern: [{\"hostname\":\"bad/hostname\"}] Inputs: [{\"hostname\":\"bad\"}]",
"Pattern: [{\"hostname\":\"bad\\\\:hostname\"}] Inputs: undefined",
"Pattern: [{\"hostname\":\"bad\\\\\\\\hostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\nhostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\rhostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\thostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [] Inputs: []",
"Pattern: [{\"pathname\":\"/foo/bar\"},{\"ignoreCase\":true}] Inputs: [{\"pathname\":\"/FOO/BAR\"}]",
"Pattern: [\"https://example.com:8080/foo?bar#baz\",{\"ignoreCase\":true}] Inputs: [{\"pathname\":\"/FOO\",\"search\":\"BAR\",\"hash\":\"BAZ\",\"baseURL\":\"https://example.com:8080\"}]",
"Pattern: [{\"pathname\":\"/([[a-z]--a])\"}] Inputs: [{\"pathname\":\"/a\"}]",
"Pattern: [{\"pathname\":\"/([[a-z]--a])\"}] Inputs: [{\"pathname\":\"/z\"}]",
"Pattern: [{\"pathname\":\"/([\\\\d&&[0-1]])\"}] Inputs: [{\"pathname\":\"/0\"}]",
Expand All @@ -15462,22 +15447,7 @@
"urlpattern.any.worker.html": [
"Pattern: [{\"pathname\":\"\\ud83d \\udeb2\"}] Inputs: []",
"Pattern: [{\"pathname\":\":a󠄀b\"}] Inputs: []",
"Pattern: [{\"protocol\":\"http\",\"port\":\"80 \"}] Inputs: [{\"protocol\":\"http\",\"port\":\"80\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"8\\t0\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"80x\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"80?x\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"80\\\\x\"}]",
"Pattern: [\"https://{sub.}?example{.com/}foo\"] Inputs: [\"https://example.com/foo\"]",
"Pattern: [{\"hostname\":\"bad#hostname\"}] Inputs: [{\"hostname\":\"bad\"}]",
"Pattern: [{\"hostname\":\"bad/hostname\"}] Inputs: [{\"hostname\":\"bad\"}]",
"Pattern: [{\"hostname\":\"bad\\\\:hostname\"}] Inputs: undefined",
"Pattern: [{\"hostname\":\"bad\\\\\\\\hostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\nhostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\rhostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\thostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [] Inputs: []",
"Pattern: [{\"pathname\":\"/foo/bar\"},{\"ignoreCase\":true}] Inputs: [{\"pathname\":\"/FOO/BAR\"}]",
"Pattern: [\"https://example.com:8080/foo?bar#baz\",{\"ignoreCase\":true}] Inputs: [{\"pathname\":\"/FOO\",\"search\":\"BAR\",\"hash\":\"BAZ\",\"baseURL\":\"https://example.com:8080\"}]",
"Pattern: [{\"pathname\":\"/([[a-z]--a])\"}] Inputs: [{\"pathname\":\"/a\"}]",
"Pattern: [{\"pathname\":\"/([[a-z]--a])\"}] Inputs: [{\"pathname\":\"/z\"}]",
"Pattern: [{\"pathname\":\"/([\\\\d&&[0-1]])\"}] Inputs: [{\"pathname\":\"/0\"}]",
Expand All @@ -15486,22 +15456,7 @@
"urlpattern.https.any.html": [
"Pattern: [{\"pathname\":\"\\ud83d \\udeb2\"}] Inputs: []",
"Pattern: [{\"pathname\":\":a󠄀b\"}] Inputs: []",
"Pattern: [{\"protocol\":\"http\",\"port\":\"80 \"}] Inputs: [{\"protocol\":\"http\",\"port\":\"80\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"8\\t0\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"80x\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"80?x\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"80\\\\x\"}]",
"Pattern: [\"https://{sub.}?example{.com/}foo\"] Inputs: [\"https://example.com/foo\"]",
"Pattern: [{\"hostname\":\"bad#hostname\"}] Inputs: [{\"hostname\":\"bad\"}]",
"Pattern: [{\"hostname\":\"bad/hostname\"}] Inputs: [{\"hostname\":\"bad\"}]",
"Pattern: [{\"hostname\":\"bad\\\\:hostname\"}] Inputs: undefined",
"Pattern: [{\"hostname\":\"bad\\\\\\\\hostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\nhostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\rhostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\thostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [] Inputs: []",
"Pattern: [{\"pathname\":\"/foo/bar\"},{\"ignoreCase\":true}] Inputs: [{\"pathname\":\"/FOO/BAR\"}]",
"Pattern: [\"https://example.com:8080/foo?bar#baz\",{\"ignoreCase\":true}] Inputs: [{\"pathname\":\"/FOO\",\"search\":\"BAR\",\"hash\":\"BAZ\",\"baseURL\":\"https://example.com:8080\"}]",
"Pattern: [{\"pathname\":\"/([[a-z]--a])\"}] Inputs: [{\"pathname\":\"/a\"}]",
"Pattern: [{\"pathname\":\"/([[a-z]--a])\"}] Inputs: [{\"pathname\":\"/z\"}]",
"Pattern: [{\"pathname\":\"/([\\\\d&&[0-1]])\"}] Inputs: [{\"pathname\":\"/0\"}]",
Expand All @@ -15510,22 +15465,7 @@
"urlpattern.https.any.worker.html": [
"Pattern: [{\"pathname\":\"\\ud83d \\udeb2\"}] Inputs: []",
"Pattern: [{\"pathname\":\":a󠄀b\"}] Inputs: []",
"Pattern: [{\"protocol\":\"http\",\"port\":\"80 \"}] Inputs: [{\"protocol\":\"http\",\"port\":\"80\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"8\\t0\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"80x\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"80?x\"}]",
"Pattern: [{\"port\":\"80\"}] Inputs: [{\"port\":\"80\\\\x\"}]",
"Pattern: [\"https://{sub.}?example{.com/}foo\"] Inputs: [\"https://example.com/foo\"]",
"Pattern: [{\"hostname\":\"bad#hostname\"}] Inputs: [{\"hostname\":\"bad\"}]",
"Pattern: [{\"hostname\":\"bad/hostname\"}] Inputs: [{\"hostname\":\"bad\"}]",
"Pattern: [{\"hostname\":\"bad\\\\:hostname\"}] Inputs: undefined",
"Pattern: [{\"hostname\":\"bad\\\\\\\\hostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\nhostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\rhostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\thostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [] Inputs: []",
"Pattern: [{\"pathname\":\"/foo/bar\"},{\"ignoreCase\":true}] Inputs: [{\"pathname\":\"/FOO/BAR\"}]",
"Pattern: [\"https://example.com:8080/foo?bar#baz\",{\"ignoreCase\":true}] Inputs: [{\"pathname\":\"/FOO\",\"search\":\"BAR\",\"hash\":\"BAZ\",\"baseURL\":\"https://example.com:8080\"}]",
"Pattern: [{\"pathname\":\"/([[a-z]--a])\"}] Inputs: [{\"pathname\":\"/a\"}]",
"Pattern: [{\"pathname\":\"/([[a-z]--a])\"}] Inputs: [{\"pathname\":\"/z\"}]",
"Pattern: [{\"pathname\":\"/([\\\\d&&[0-1]])\"}] Inputs: [{\"pathname\":\"/0\"}]",
Expand Down
Loading