-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathurltestdata_whatwg.txt
More file actions
331 lines (315 loc) · 15.2 KB
/
urltestdata_whatwg.txt
File metadata and controls
331 lines (315 loc) · 15.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
-- IMPORTED FROM: https://raw.github.com/w3c/web-platform-tests/master/url/urltestdata.txt
--
-- FORMAT NOT DOCUMENTED YET (parser is urltestparser.js)
-- Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js
http://example\t.\norg http://example.org/foo/bar s:http h:example.org p:/
http://user:pass@foo:21/bar;par?b#c s:http u:user pass:pass h:foo port:21 p:/bar;par q:?b f:#c
http:foo.com s:http h:example.org p:/foo/foo.com
\t\s\s\s:foo.com\s\s\s\n s:http h:example.org p:/foo/:foo.com
\sfoo.com\s\s s:http h:example.org p:/foo/foo.com
-- FIXME(https://www.w3.org/Bugs/Public/show_bug.cgi?id=24246): a:\t\sfoo.com s:a p:%20foo.com
http://f:21/\sb\s?\sd\s#\se\s s:http h:f port:21 p:/%20b%20 q:?%20d%20 f:#\se
http://f:/c s:http h:f p:/c
http://f:0/c s:http h:f port:0 p:/c
http://f:00000000000000/c s:http h:f port:0 p:/c
http://f:00000000000000000000080/c s:http h:f p:/c
http://f:b/c
http://f:\s/c
http://f:\n/c s:http h:f p:/c
http://f:fifty-two/c
http://f:999999/c s:http h:f port:999999 p:/c
http://f:\s21\s/\sb\s?\sd\s#\se\s
s:http h:example.org p:/foo/bar
\s\s\t s:http h:example.org p:/foo/bar
:foo.com/ s:http h:example.org p:/foo/:foo.com/
:foo.com\\ s:http h:example.org p:/foo/:foo.com/
: s:http h:example.org p:/foo/:
:a s:http h:example.org p:/foo/:a
:/ s:http h:example.org p:/foo/:/
:\\ s:http h:example.org p:/foo/:/
:# s:http h:example.org p:/foo/: f:#
# s:http h:example.org p:/foo/bar f:#
#/ s:http h:example.org p:/foo/bar f:#/
#\\ s:http h:example.org p:/foo/bar f:#\\
#;? s:http h:example.org p:/foo/bar f:#;?
? s:http h:example.org p:/foo/bar q:?
/ s:http h:example.org p:/
:23 s:http h:example.org p:/foo/:23
/:23 s:http h:example.org p:/:23
:: s:http h:example.org p:/foo/::
::23 s:http h:example.org p:/foo/::23
foo:// s:foo p://
http://a:b@c:29/d s:http u:a pass:b h:c port:29 p:/d
http://a@c s:http u:a h:c p:/
http://:p@c s:http pass:p h:c p:/
http::@c:29 s:http h:example.org p:/foo/:@c:29
http://&a:foo(b]c@d:2/ s:http u:&a pass:foo(b]c h:d port:2 p:/
http://::@c@d:2 s:http pass::%40c h:d port:2 p:/
http://foo.com:b@d/ s:http u:foo.com pass:b h:d p:/
http://foo.com/\\@ s:http h:foo.com p://@
http://foo.com:80\\path s:http h:foo.com port:80 p:/path
http://foo.com:80?query s:http h:foo.com port:80 p:/ q:?query
http://foo.com:80#frag s:http h:foo.com port:80 p:/ f:#frag
http:\\\\foo.com\\ s:http h:foo.com p:/
http:\\\\a\\b:c\\d@foo.com\\ s:http h:a p:/b:c/d@foo.com/
foo:/ s:foo p:/
foo:/bar.com/ s:foo p:/bar.com/
foo:///////// s:foo p://///////
foo://///////bar.com/ s:foo p://///////bar.com/
foo:////:///// s:foo p:////://///
c:/foo s:c p:/foo
//foo/bar s:http h:foo p:/bar
http://foo/path;a??e#f#g s:http h:foo p:/path;a q:??e f:#f#g
http://foo/abcd?efgh?ijkl s:http h:foo p:/abcd q:?efgh?ijkl
http://foo/abcd#foo?bar s:http h:foo p:/abcd f:#foo?bar
[61:24:74]:98 s:http h:example.org p:/foo/[61:24:74]:98
http:[61:27]/:foo s:http h:example.org p:/foo/[61:27]/:foo
http://[1::2]:3:4
http://2001::1
http://2001::1]
http://2001::1]:80
http://[2001::1] s:http h:[2001::1] p:/
http://[2001::1]:80 s:http h:[2001::1] p:/
http:/example.com/ s:http h:example.org p:/example.com/
ftp:/example.com/ s:ftp h:example.com p:/
https:/example.com/ s:https h:example.com p:/
madeupscheme:/example.com/ s:madeupscheme p:/example.com/
file:/example.com/ s:file p:/example.com/
ftps:/example.com/ s:ftps p:/example.com/
gopher:/example.com/ s:gopher h:example.com p:/
ws:/example.com/ s:ws h:example.com p:/
wss:/example.com/ s:wss h:example.com p:/
data:/example.com/ s:data p:/example.com/
javascript:/example.com/ s:javascript p:/example.com/
mailto:/example.com/ s:mailto p:/example.com/
http:example.com/ s:http h:example.org p:/foo/example.com/
ftp:example.com/ s:ftp h:example.com p:/
https:example.com/ s:https h:example.com p:/
madeupscheme:example.com/ s:madeupscheme p:example.com/
ftps:example.com/ s:ftps p:example.com/
gopher:example.com/ s:gopher h:example.com p:/
ws:example.com/ s:ws h:example.com p:/
wss:example.com/ s:wss h:example.com p:/
data:example.com/ s:data p:example.com/
javascript:example.com/ s:javascript p:example.com/
mailto:example.com/ s:mailto p:example.com/
/a/b/c s:http h:example.org p:/a/b/c
/a/\s/c s:http h:example.org p:/a/%20/c
/a%2fc s:http h:example.org p:/a%2Fc
/a/%2f/c s:http h:example.org p:/a/%2F/c
#\u03B2 s:http h:example.org p:/foo/bar f:#%CE%B2
data:text/html,test#test s:data p:text/html,test f:#test
-- Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html
file:c:\\foo\\bar.html file:///tmp/mock/path s:file p:/c:/foo/bar.html
\s\sFile:c|////foo\\bar.html s:file p:/c:////foo/bar.html
C|/foo/bar s:file p:/C:/foo/bar
/C|\\foo\\bar s:file p:/C:/foo/bar
//C|/foo/bar s:file p:/C:/foo/bar
//server/file s:file h:server p:/file
\\\\server\\file s:file h:server p:/file
/\\server/file s:file h:server p:/file
file:///foo/bar.txt s:file p:/foo/bar.txt
file:///home/me s:file p:/home/me
// s:file p:/
/// s:file p:/
///test s:file p:/test
file://test s:file h:test p:/
file://localhost s:file h:localhost p:/
file://localhost/ s:file h:localhost p:/
file://localhost/test s:file h:localhost p:/test
test s:file p:/tmp/mock/test
file:test s:file p:/tmp/mock/test
-- File samples from Wikipedia
file:///etc/fstab s:file p:/etc/fstab
file:////etc/fstab s:file p://etc/fstab
file:///c:/WINDOWS/clock.avi s:file p:/c:/WINDOWS/clock.avi
file:///c|/WINDOWS/clock.avi s:file p:/c:/WINDOWS/clock.avi
file://[badhost]/etc/fstab
-- TODO: Parsing on this with RFC 2396 enabled might be broken
file://localhost/c|/WINDOWS/clock.avi s:file h:localhost p:/c:/WINDOWS/clock.avi
file://localhost/c:/WINDOWS/clock.avi s:file h:localhost p:/c:/WINDOWS/clock.avi
-- Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js
http://example.com/././foo about:blank s:http h:example.com p:/foo
http://example.com/./.foo s:http h:example.com p:/.foo
http://example.com/foo/. s:http h:example.com p:/foo/
http://example.com/foo/./ s:http h:example.com p:/foo/
http://example.com/foo/bar/.. s:http h:example.com p:/foo/
http://example.com/foo/bar/../ s:http h:example.com p:/foo/
http://example.com/foo/..bar s:http h:example.com p:/foo/..bar
http://example.com/foo/bar/../ton s:http h:example.com p:/foo/ton
http://example.com/foo/bar/../ton/../../a s:http h:example.com p:/a
http://example.com/foo/../../.. s:http h:example.com p:/
http://example.com/foo/../../../ton s:http h:example.com p:/ton
http://example.com/foo/%2e s:http h:example.com p:/foo/
http://example.com/foo/%2e%2 s:http h:example.com p:/foo/%2E%2
http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar s:http h:example.com p:/%2E.bar
http://example.com////../.. s:http h:example.com p://
http://example.com/foo/bar//../.. s:http h:example.com p:/foo/
http://example.com/foo/bar//.. s:http h:example.com p:/foo/bar/
http://example.com/foo s:http h:example.com p:/foo
http://example.com/%20foo s:http h:example.com p:/%20foo
http://example.com/foo% s:http h:example.com p:/foo%
http://example.com/foo%2 s:http h:example.com p:/foo%2
http://example.com/foo%2zbar s:http h:example.com p:/foo%2zbar
http://example.com/foo%2\u00C2\u00A9zbar s:http h:example.com p:/foo%2%C3%82%C2%A9zbar
http://example.com/foo%41%7a s:http h:example.com p:/foo%41%7A
http://example.com/foo\t\u0091%91 s:http h:example.com p:/foo%C2%91%91
http://example.com/foo%00%51 s:http h:example.com p:/foo%00%51
http://example.com/(%28:%3A%29) s:http h:example.com p:/(%28:%3A%29)
http://example.com/%3A%3a%3C%3c s:http h:example.com p:/%3A%3A%3C%3C
http://example.com/foo\tbar s:http h:example.com p:/foobar
http://example.com\\\\foo\\\\bar s:http h:example.com p://foo//bar
http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd s:http h:example.com p:/%7Ffp3%3Eju%3Dduvgw%3Dd
http://example.com/@asdf%40 s:http h:example.com p:/@asdf%40
http://example.com/\u4F60\u597D\u4F60\u597D s:http h:example.com p:/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD
http://example.com/\u2025/foo s:http h:example.com p:/%E2%80%A5/foo
http://example.com/\uFEFF/foo s:http h:example.com p:/%EF%BB%BF/foo
http://example.com/\u202E/foo/\u202D/bar s:http h:example.com p:/%E2%80%AE/foo/%E2%80%AD/bar
-- Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js
http://www.google.com/foo?bar=baz# about:blank s:http h:www.google.com p:/foo q:?bar=baz f:#
-- FIXME: In the following these, \u00BB is percent-encoded by WHATWG (not Blink or Gecko though). We added a corrected test.
-- FIXME: http://www.google.com/foo?bar=baz#\s\u00BB s:http h:www.google.com p:/foo q:?bar=baz f:#\s\u00BB
http://www.google.com/foo?bar=baz#\s\u00BB s:http h:www.google.com p:/foo q:?bar=baz f:#\s%C2%BB
http://[www.google.com]/
http://www.google.com s:http h:www.google.com p:/
http://192.0x00A80001 s:http h:192.0x00a80001 p:/
http://www/foo%2Ehtml s:http h:www p:/foo%2Ehtml
http://www/foo/%2E/html s:http h:www p:/foo/html
http://user:pass@/
http://%25DOMAIN:foobar@foodomain.com/ s:http u:%25DOMAIN pass:foobar h:foodomain.com p:/
http:\\\\www.google.com\\foo s:http h:www.google.com p:/foo
http://foo:80/ s:http h:foo p:/
http://foo:81/ s:http h:foo port:81 p:/
httpa://foo:80/ s:httpa p://foo:80/
http://foo:-80/
https://foo:443/ s:https h:foo p:/
https://foo:80/ s:https h:foo port:80 p:/
ftp://foo:21/ s:ftp h:foo p:/
ftp://foo:80/ s:ftp h:foo port:80 p:/
gopher://foo:70/ s:gopher h:foo p:/
gopher://foo:443/ s:gopher h:foo port:443 p:/
ws://foo:80/ s:ws h:foo p:/
ws://foo:81/ s:ws h:foo port:81 p:/
ws://foo:443/ s:ws h:foo port:443 p:/
ws://foo:815/ s:ws h:foo port:815 p:/
wss://foo:80/ s:wss h:foo port:80 p:/
wss://foo:81/ s:wss h:foo port:81 p:/
wss://foo:443/ s:wss h:foo p:/
wss://foo:815/ s:wss h:foo port:815 p:/
http:/example.com/ s:http h:example.com p:/
ftp:/example.com/ s:ftp h:example.com p:/
https:/example.com/ s:https h:example.com p:/
madeupscheme:/example.com/ s:madeupscheme p:/example.com/
file:/example.com/ s:file p:/example.com/
ftps:/example.com/ s:ftps p:/example.com/
gopher:/example.com/ s:gopher h:example.com p:/
ws:/example.com/ s:ws h:example.com p:/
wss:/example.com/ s:wss h:example.com p:/
data:/example.com/ s:data p:/example.com/
javascript:/example.com/ s:javascript p:/example.com/
mailto:/example.com/ s:mailto p:/example.com/
http:example.com/ s:http h:example.com p:/
ftp:example.com/ s:ftp h:example.com p:/
https:example.com/ s:https h:example.com p:/
madeupscheme:example.com/ s:madeupscheme p:example.com/
ftps:example.com/ s:ftps p:example.com/
gopher:example.com/ s:gopher h:example.com p:/
ws:example.com/ s:ws h:example.com p:/
wss:example.com/ s:wss h:example.com p:/
data:example.com/ s:data p:example.com/
javascript:example.com/ s:javascript p:example.com/
mailto:example.com/ s:mailto p:example.com/
-- Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html
http:@www.example.com about:blank s:http h:www.example.com p:/
http:/@www.example.com s:http h:www.example.com p:/
http://@www.example.com s:http h:www.example.com p:/
http:a:b@www.example.com s:http u:a pass:b h:www.example.com p:/
http:/a:b@www.example.com s:http u:a pass:b h:www.example.com p:/
http://a:b@www.example.com s:http u:a pass:b h:www.example.com p:/
http://@pple.com s:http h:pple.com p:/
http::b@www.example.com s:http pass:b h:www.example.com p:/
http:/:b@www.example.com s:http pass:b h:www.example.com p:/
http://:b@www.example.com s:http pass:b h:www.example.com p:/
http:/:@/www.example.com
http://user@/www.example.com
http:@/www.example.com
http:/@/www.example.com
http://@/www.example.com
https:@/www.example.com
http:a:b@/www.example.com
http:/a:b@/www.example.com
http://a:b@/www.example.com
http::@/www.example.com
http:a:@www.example.com s:http u:a pass: h:www.example.com p:/
http:/a:@www.example.com s:http u:a pass: h:www.example.com p:/
http://a:@www.example.com s:http u:a pass: h:www.example.com p:/
http://www.@pple.com s:http u:www. h:pple.com p:/
http:@:www.example.com
http:/@:www.example.com
http://@:www.example.com
http://:@www.example.com s:http pass: h:www.example.com p:/
-- Others
/ http://www.example.com/test s:http h:www.example.com p:/
/test.txt s:http h:www.example.com p:/test.txt
. s:http h:www.example.com p:/
.. s:http h:www.example.com p:/
test.txt s:http h:www.example.com p:/test.txt
./test.txt s:http h:www.example.com p:/test.txt
../test.txt s:http h:www.example.com p:/test.txt
../aaa/test.txt s:http h:www.example.com p:/aaa/test.txt
../../test.txt s:http h:www.example.com p:/test.txt
\u4E2D/test.txt s:http h:www.example.com p:/%E4%B8%AD/test.txt
http://www.example2.com s:http h:www.example2.com p:/
-- Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/anchor.html
http://example.com/#hello,\sworld s:http h:example.com p:/ f:hello,\sworld
-- TODO: http://example.com/#\xc2\xa9
-- TODO: http://example.com/#\ud800\udf00ss s:http h:example.com p:/ f:\ud800\udf00ss
-- TODO: to be continued...
--
-- Based on Android's libcore.java.net.URLTest
--
-- http://code.google.com/p/android/issues/detail?id=12724
http://www.google.com:80/example?language[id]=2 s:http h:www.google.com port:80 p:/example q:language[id]=2
-- Case mapping
HTTP://localhost/foo?bar=baz#quux s:http h:localhost p:/foo q:bar=baz f:quux
http://LOCALHOST/foo?bar=baz#quux s:http h:localhost p:/foo q:bar=baz f:quux
http://localhost/FOO?bar=baz#quux s:http h:localhost p:/FOO q:bar=baz f:quux
http://localhost/foo?BAR=BAZ#quux s:http h:localhost p:/foo q:BAR=BAZ f:quux
http://localhost/foo?bar=baz#QUUX s:http h:localhost p:/foo q:bar=baz f:QUUX
-- Unicode misc
http://example.com/\uD801\uDC00 s:http h:example.com p:/%F0%90%90%80
http://example.com/\uD83D\uDC35 s:http h:example.com p:/%F0%9F%90%B5
-- unwise characters "{", "}", "|", "\", "^", "~", "[", "]", and "`"
http://example.com/~user s:http h:example.com p:/~user
http://example.com/^{}|[]` s:http h:example.com p:/^{}|[]%60
http://example.com/?^{}|[]` s:http h:example.com p:/ q:?^{}|[]%60
http://example.com/#^{}|[]` s:http h:example.com p:/ f:#^{}|[]`
--
-- Data scheme
--
data:foo s:data p:foo
data:%6a s:data p:%6A
data:\sa s:data p:\sa
--
-- Javascript scheme
--
javascript:\stext();\sbar(); s:javascript p:\stext();\sbar();
--
-- Misc schemes
--
-- 'aaa' URIs not valid as of RFC 3986.
aaa://host.example.com:1813;transport=udp;protocol=rad s:aaa p://host.example.com:1813;transport=udp;protocol=rad
about:blank s:about p:blank
adiumxtra://www.adiumxtras.com/download/0000 s:adiumxtra p://www.adiumxtras.com/download/0000
aim:goim?screenname=notarealuser&message=This+is+my+message s:aim p:goim q:?screenname=notarealuser&message=This+is+my+message
apt:gcc s:apt p:gcc
callto:+34600800900 s:callto p:+34600800900
feed:https://example.com/rss.xml s:feed p:https://example.com/rss.xml
-- 'ed2k' URIs use hierarchical scheme prefix, but they aren't
ed2k://|file|The_Two_Towers-The_Purist_Edit-Trailer.avi|14997504|965c013e991ee246d63d45ea71954c4d|/|sources,202.89.123.6:4662|/ s:ed2k p://|file|The_Two_Towers-The_Purist_Edit-Trailer.avi|14997504|965c013e991ee246d63d45ea71954c4d|/|sources,202.89.123.6:4662|/
magnet:?xt=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C s:magnet p: q:?xt=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C
mailto:user@example.com s:mailto p:user@example.com
--
-- Misc Unicode
--
http://foo:\uD83D\uDCA9@example.com/bar s:http h:example.com p:/bar u:foo pass:%F0%9F%92%A9