|
102 | 102 | }
|
103 | 103 | },
|
104 | 104 | {
|
105 |
| - "comment": "Can’t switch from special scheme to non-special. Note: this may change, see https://github.com/whatwg/url/issues/104", |
| 105 | + "comment": "Can’t switch from special scheme to non-special", |
106 | 106 | "href": "http://example.net",
|
107 | 107 | "new_value": "b",
|
108 | 108 | "expected": {
|
109 | 109 | "href": "http://example.net/",
|
110 | 110 | "protocol": "http:"
|
111 | 111 | }
|
112 | 112 | },
|
| 113 | + { |
| 114 | + "href": "https://example.net", |
| 115 | + "new_value": "s", |
| 116 | + "expected": { |
| 117 | + "href": "https://example.net/", |
| 118 | + "protocol": "https:" |
| 119 | + } |
| 120 | + }, |
| 121 | + { |
| 122 | + "href": "ftp://example.net", |
| 123 | + "new_value": "test", |
| 124 | + "expected": { |
| 125 | + "href": "ftp://example.net/", |
| 126 | + "protocol": "ftp:" |
| 127 | + } |
| 128 | + }, |
113 | 129 | {
|
114 | 130 | "comment": "Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.",
|
115 | 131 | "href": "mailto:[email protected]",
|
|
120 | 136 | }
|
121 | 137 | },
|
122 | 138 | {
|
123 |
| - "comment": "Can’t switch from non-special scheme to special. Note: this may change, see https://github.com/whatwg/url/issues/104", |
| 139 | + "comment": "Can’t switch from non-special scheme to special", |
124 | 140 | "href": "ssh://[email protected]",
|
125 | 141 | "new_value": "http",
|
126 | 142 | "expected": {
|
127 | 143 | "href": "ssh://[email protected]/",
|
128 | 144 | "protocol": "ssh:"
|
129 | 145 | }
|
130 | 146 | },
|
| 147 | + { |
| 148 | + "href": "ssh://[email protected]", |
| 149 | + "new_value": "gopher", |
| 150 | + "expected": { |
| 151 | + "href": "ssh://[email protected]/", |
| 152 | + "protocol": "ssh:" |
| 153 | + } |
| 154 | + }, |
| 155 | + { |
| 156 | + "href": "ssh://[email protected]", |
| 157 | + "new_value": "file", |
| 158 | + "expected": { |
| 159 | + "href": "ssh://[email protected]/", |
| 160 | + "protocol": "ssh:" |
| 161 | + } |
| 162 | + }, |
| 163 | + { |
| 164 | + "href": "nonsense:///test", |
| 165 | + "new_value": "https", |
| 166 | + "expected": { |
| 167 | + "href": "nonsense:///test", |
| 168 | + "protocol": "nonsense:" |
| 169 | + } |
| 170 | + }, |
131 | 171 | {
|
132 | 172 | "comment": "Stuff after the first ':' is ignored",
|
133 | 173 | "href": "http://example.net",
|
|
0 commit comments