Skip to content

Commit

Permalink
[URL] Ensure that path-only URLs do not have their paths erased by th…
Browse files Browse the repository at this point in the history
…e pathname setter.
  • Loading branch information
karwa authored and annevk committed Jun 25, 2021
1 parent 7f66a36 commit 83162f0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions url/resources/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,33 @@
"pathname": "me@example.net"
}
},
{
"comment": "Special URLs cannot have their paths erased",
"href": "file:///some/path",
"new_value": "",
"expected": {
"href": "file:///",
"pathname": "/"
}
},
{
"comment": "Non-special URLs can have their paths erased",
"href": "foo://somehost/some/path",
"new_value": "",
"expected": {
"href": "foo://somehost",
"pathname": ""
}
},
{
"comment": "Path-only URLs cannot have their paths erased",
"href": "foo:/some/path",
"new_value": "",
"expected": {
"href": "foo:/",
"pathname": "/"
}
},
{
"href": "unix:/run/foo.socket?timeout=10",
"new_value": "/var/log/../run/bar.socket",
Expand Down

0 comments on commit 83162f0

Please sign in to comment.