-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
URL: protocol setter and special URLs (#4413)
* URL: protocol setter and special URLs Closes whatwg/url#104.
- Loading branch information
Showing
1 changed file
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,14 +102,30 @@ | |
} | ||
}, | ||
{ | ||
"comment": "Can’t switch from special scheme to non-special. Note: this may change, see https://github.com/whatwg/url/issues/104", | ||
"comment": "Can’t switch from special scheme to non-special", | ||
"href": "http://example.net", | ||
"new_value": "b", | ||
"expected": { | ||
"href": "http://example.net/", | ||
"protocol": "http:" | ||
} | ||
}, | ||
{ | ||
"href": "https://example.net", | ||
"new_value": "s", | ||
"expected": { | ||
"href": "https://example.net/", | ||
"protocol": "https:" | ||
} | ||
}, | ||
{ | ||
"href": "ftp://example.net", | ||
"new_value": "test", | ||
"expected": { | ||
"href": "ftp://example.net/", | ||
"protocol": "ftp:" | ||
} | ||
}, | ||
{ | ||
"comment": "Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.", | ||
"href": "mailto:[email protected]", | ||
|
@@ -120,14 +136,38 @@ | |
} | ||
}, | ||
{ | ||
"comment": "Can’t switch from non-special scheme to special. Note: this may change, see https://github.com/whatwg/url/issues/104", | ||
"comment": "Can’t switch from non-special scheme to special", | ||
"href": "ssh://[email protected]", | ||
"new_value": "http", | ||
"expected": { | ||
"href": "ssh://[email protected]/", | ||
"protocol": "ssh:" | ||
} | ||
}, | ||
{ | ||
"href": "ssh://[email protected]", | ||
"new_value": "gopher", | ||
"expected": { | ||
"href": "ssh://[email protected]/", | ||
"protocol": "ssh:" | ||
} | ||
}, | ||
{ | ||
"href": "ssh://[email protected]", | ||
"new_value": "file", | ||
"expected": { | ||
"href": "ssh://[email protected]/", | ||
"protocol": "ssh:" | ||
} | ||
}, | ||
{ | ||
"href": "nonsense:///test", | ||
"new_value": "https", | ||
"expected": { | ||
"href": "nonsense:///test", | ||
"protocol": "nonsense:" | ||
} | ||
}, | ||
{ | ||
"comment": "Stuff after the first ':' is ignored", | ||
"href": "http://example.net", | ||
|