urltestdata.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. # This file is from https://github.com/annevk/web-platform-tests/raw/url/url/urltestdata.txt
  2. # and used under a 3-clause BSD license.
  3. # FORMAT NOT DOCUMENTED YET (parser is urltestparser.js)
  4. # https://github.com/annevk/web-platform-tests/blob/url/url/urltestparser.js
  5. # Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js
  6. http://example\t.\norg http://example.org/foo/bar s:http h:example.org p:/
  7. 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
  8. http:foo.com s:http h:example.org p:/foo/foo.com
  9. \t\s\s\s:foo.com\s\s\s\n s:http h:example.org p:/foo/:foo.com
  10. \sfoo.com\s\s s:http h:example.org p:/foo/foo.com
  11. a:\t\sfoo.com s:a p:%20foo.com
  12. http://f:21/\sb\s?\sd\s#\se\s s:http h:f port:21 p:/%20b%20 q:?%20d%20 f:#\se
  13. http://f:/c s:http h:f p:/c
  14. http://f:0/c s:http h:f port:0 p:/c
  15. http://f:00000000000000/c s:http h:f port:0 p:/c
  16. http://f:00000000000000000000080/c s:http h:f p:/c
  17. http://f:b/c
  18. http://f:\s/c
  19. http://f:\n/c s:http h:f p:/c
  20. http://f:fifty-two/c
  21. http://f:999999/c s:http h:f port:999999 p:/c
  22. http://f:\s21\s/\sb\s?\sd\s#\se\s
  23. s:http h:example.org p:/foo/bar
  24. \s\s\t s:http h:example.org p:/foo/bar
  25. :foo.com/ s:http h:example.org p:/foo/:foo.com/
  26. :foo.com\\ s:http h:example.org p:/foo/:foo.com/
  27. : s:http h:example.org p:/foo/:
  28. :a s:http h:example.org p:/foo/:a
  29. :/ s:http h:example.org p:/foo/:/
  30. :\\ s:http h:example.org p:/foo/:/
  31. :# s:http h:example.org p:/foo/: f:#
  32. # s:http h:example.org p:/foo/bar f:#
  33. #/ s:http h:example.org p:/foo/bar f:#/
  34. #\\ s:http h:example.org p:/foo/bar f:#\\
  35. #;? s:http h:example.org p:/foo/bar f:#;?
  36. ? s:http h:example.org p:/foo/bar q:?
  37. / s:http h:example.org p:/
  38. :23 s:http h:example.org p:/foo/:23
  39. /:23 s:http h:example.org p:/:23
  40. :: s:http h:example.org p:/foo/::
  41. ::23 s:http h:example.org p:/foo/::23
  42. foo:// s:foo p://
  43. http://a:b@c:29/d s:http u:a pass:b h:c port:29 p:/d
  44. http::@c:29 s:http h:example.org p:/foo/:@c:29
  45. http://&a:foo(b]c@d:2/ s:http u:&a pass:foo(b]c h:d port:2 p:/
  46. http://::@c@d:2 s:http pass::c%40 h:d port:2 p:/
  47. http://foo.com:b@d/ s:http u:foo.com pass:b h:d p:/
  48. http://foo.com/\\@ s:http h:foo.com p://@
  49. http:\\\\foo.com\\ s:http h:foo.com p:/
  50. http:\\\\a\\b:c\\d@foo.com\\ s:http h:a p:/b:c/d@foo.com/
  51. foo:/ s:foo p:/
  52. foo:/bar.com/ s:foo p:/bar.com/
  53. foo:///////// s:foo p://///////
  54. foo://///////bar.com/ s:foo p://///////bar.com/
  55. foo:////:///// s:foo p:////://///
  56. c:/foo s:c p:/foo
  57. //foo/bar s:http h:foo p:/bar
  58. http://foo/path;a??e#f#g s:http h:foo p:/path;a q:??e f:#f#g
  59. http://foo/abcd?efgh?ijkl s:http h:foo p:/abcd q:?efgh?ijkl
  60. http://foo/abcd#foo?bar s:http h:foo p:/abcd f:#foo?bar
  61. [61:24:74]:98 s:http h:example.org p:/foo/[61:24:74]:98
  62. http:[61:27]/:foo s:http h:example.org p:/foo/[61:27]/:foo
  63. http://[1::2]:3:4
  64. http://2001::1
  65. http://2001::1]
  66. http://2001::1]:80
  67. http://[2001::1] s:http h:[2001::1] p:/
  68. http://[2001::1]:80 s:http h:[2001::1] p:/
  69. http:/example.com/ s:http h:example.org p:/example.com/
  70. ftp:/example.com/ s:ftp h:example.com p:/
  71. https:/example.com/ s:https h:example.com p:/
  72. madeupscheme:/example.com/ s:madeupscheme p:/example.com/
  73. file:/example.com/ s:file p:/example.com/
  74. ftps:/example.com/ s:ftps p:/example.com/
  75. gopher:/example.com/ s:gopher h:example.com p:/
  76. ws:/example.com/ s:ws h:example.com p:/
  77. wss:/example.com/ s:wss h:example.com p:/
  78. data:/example.com/ s:data p:/example.com/
  79. javascript:/example.com/ s:javascript p:/example.com/
  80. mailto:/example.com/ s:mailto p:/example.com/
  81. http:example.com/ s:http h:example.org p:/foo/example.com/
  82. ftp:example.com/ s:ftp h:example.com p:/
  83. https:example.com/ s:https h:example.com p:/
  84. madeupscheme:example.com/ s:madeupscheme p:example.com/
  85. ftps:example.com/ s:ftps p:example.com/
  86. gopher:example.com/ s:gopher h:example.com p:/
  87. ws:example.com/ s:ws h:example.com p:/
  88. wss:example.com/ s:wss h:example.com p:/
  89. data:example.com/ s:data p:example.com/
  90. javascript:example.com/ s:javascript p:example.com/
  91. mailto:example.com/ s:mailto p:example.com/
  92. /a/b/c s:http h:example.org p:/a/b/c
  93. /a/\s/c s:http h:example.org p:/a/%20/c
  94. /a%2fc s:http h:example.org p:/a%2fc
  95. /a/%2f/c s:http h:example.org p:/a/%2f/c
  96. #\u03B2 s:http h:example.org p:/foo/bar f:#\u03B2
  97. data:text/html,test#test s:data p:text/html,test f:#test
  98. # Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html
  99. file:c:\\foo\\bar.html file:///tmp/mock/path s:file p:/c:/foo/bar.html
  100. \s\sFile:c|////foo\\bar.html s:file p:/c:////foo/bar.html
  101. C|/foo/bar s:file p:/C:/foo/bar
  102. /C|\\foo\\bar s:file p:/C:/foo/bar
  103. //C|/foo/bar s:file p:/C:/foo/bar
  104. //server/file s:file h:server p:/file
  105. \\\\server\\file s:file h:server p:/file
  106. /\\server/file s:file h:server p:/file
  107. file:///foo/bar.txt s:file p:/foo/bar.txt
  108. file:///home/me s:file p:/home/me
  109. file:c:\\foo\\bar.html s:file p:/c:/foo/bar.html
  110. // s:file p:/
  111. /// s:file p:/
  112. ///test s:file p:/test
  113. file://test s:file h:test p:/
  114. file://localhost s:file h:localhost p:/
  115. file://localhost/ s:file h:localhost p:/
  116. file://localhost/test s:file h:localhost p:/test
  117. test s:file p:/tmp/mock/test
  118. file:test s:file p:/tmp/mock/test
  119. # Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js
  120. http://example.com/././foo about:blank s:http h:example.com p:/foo
  121. http://example.com/./.foo s:http h:example.com p:/.foo
  122. http://example.com/foo/. s:http h:example.com p:/foo/
  123. http://example.com/foo/./ s:http h:example.com p:/foo/
  124. http://example.com/foo/bar/.. s:http h:example.com p:/foo/
  125. http://example.com/foo/bar/../ s:http h:example.com p:/foo/
  126. http://example.com/foo/..bar s:http h:example.com p:/foo/..bar
  127. http://example.com/foo/bar/../ton s:http h:example.com p:/foo/ton
  128. http://example.com/foo/bar/../ton/../../a s:http h:example.com p:/a
  129. http://example.com/foo/../../.. s:http h:example.com p:/
  130. http://example.com/foo/../../../ton s:http h:example.com p:/ton
  131. http://example.com/foo/%2e s:http h:example.com p:/foo/
  132. http://example.com/foo/%2e%2 s:http h:example.com p:/foo/%2e%2
  133. http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar s:http h:example.com p:/%2e.bar
  134. http://example.com////../.. s:http h:example.com p://
  135. http://example.com/foo/bar//../.. s:http h:example.com p:/foo/
  136. http://example.com/foo/bar//.. s:http h:example.com p:/foo/bar/
  137. http://example.com/foo/bar/.. s:http h:example.com p:/foo/
  138. http://example.com/foo s:http h:example.com p:/foo
  139. http://example.com/%20foo s:http h:example.com p:/%20foo
  140. http://example.com/foo% s:http h:example.com p:/foo%
  141. http://example.com/foo%2 s:http h:example.com p:/foo%2
  142. http://example.com/foo%2zbar s:http h:example.com p:/foo%2zbar
  143. http://example.com/foo%2\u00C2\u00A9zbar s:http h:example.com p:/foo%2%C3%82%C2%A9zbar
  144. http://example.com/foo%41%7a s:http h:example.com p:/foo%41%7a
  145. http://example.com/foo\t\u0091%91 s:http h:example.com p:/foo%C2%91%91
  146. http://example.com/foo%00%51 s:http h:example.com p:/foo%00%51
  147. http://example.com/(%28:%3A%29) s:http h:example.com p:/(%28:%3A%29)
  148. http://example.com/%3A%3a%3C%3c s:http h:example.com p:/%3A%3a%3C%3c
  149. http://example.com/foo\tbar s:http h:example.com p:/foobar
  150. http://example.com\\\\foo\\\\bar s:http h:example.com p://foo//bar
  151. http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd s:http h:example.com p:/%7Ffp3%3Eju%3Dduvgw%3Dd
  152. http://example.com/@asdf%40 s:http h:example.com p:/@asdf%40
  153. 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
  154. http://example.com/\u2025/foo s:http h:example.com p:/%E2%80%A5/foo
  155. http://example.com/\uFEFF/foo s:http h:example.com p:/%EF%BB%BF/foo
  156. http://example.com/\u202E/foo/\u202D/bar s:http h:example.com p:/%E2%80%AE/foo/%E2%80%AD/bar
  157. # Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js
  158. http://www.google.com/foo?bar=baz# about:blank s:http h:www.google.com p:/foo q:?bar=baz f:#
  159. http://www.google.com/foo?bar=baz#\s\u00BB s:http h:www.google.com p:/foo q:?bar=baz f:#\s\u00BB
  160. http://[www.google.com]/ s:http h:[www.google.com] p:/
  161. http://www.google.com s:http h:www.google.com p:/
  162. http://192.0x00A80001 s:http h:192.0x00a80001 p:/
  163. http://www/foo%2Ehtml s:http h:www p:/foo%2Ehtml
  164. http://www/foo/%2E/html s:http h:www p:/foo/html
  165. http://user:pass@/
  166. http://%25DOMAIN:foobar@foodomain.com/ s:http u:%25DOMAIN pass:foobar h:foodomain.com p:/
  167. http:\\\\www.google.com\\foo s:http h:www.google.com p:/foo
  168. http://foo:80/ s:http h:foo p:/
  169. http://foo:81/ s:http h:foo port:81 p:/
  170. httpa://foo:80/ s:httpa p://foo:80/
  171. http://foo:-80/
  172. https://foo:443/ s:https h:foo p:/
  173. https://foo:80/ s:https h:foo port:80 p:/
  174. ftp://foo:21/ s:ftp h:foo p:/
  175. ftp://foo:80/ s:ftp h:foo port:80 p:/
  176. gopher://foo:70/ s:gopher h:foo p:/
  177. gopher://foo:443/ s:gopher h:foo port:443 p:/
  178. ws://foo:80/ s:ws h:foo p:/
  179. ws://foo:81/ s:ws h:foo port:81 p:/
  180. ws://foo:443/ s:ws h:foo port:443 p:/
  181. ws://foo:815/ s:ws h:foo port:815 p:/
  182. wss://foo:80/ s:wss h:foo port:80 p:/
  183. wss://foo:81/ s:wss h:foo port:81 p:/
  184. wss://foo:443/ s:wss h:foo p:/
  185. wss://foo:815/ s:wss h:foo port:815 p:/
  186. http:/example.com/ s:http h:example.com p:/
  187. ftp:/example.com/ s:ftp h:example.com p:/
  188. https:/example.com/ s:https h:example.com p:/
  189. madeupscheme:/example.com/ s:madeupscheme p:/example.com/
  190. file:/example.com/ s:file p:/example.com/
  191. ftps:/example.com/ s:ftps p:/example.com/
  192. gopher:/example.com/ s:gopher h:example.com p:/
  193. ws:/example.com/ s:ws h:example.com p:/
  194. wss:/example.com/ s:wss h:example.com p:/
  195. data:/example.com/ s:data p:/example.com/
  196. javascript:/example.com/ s:javascript p:/example.com/
  197. mailto:/example.com/ s:mailto p:/example.com/
  198. http:example.com/ s:http h:example.com p:/
  199. ftp:example.com/ s:ftp h:example.com p:/
  200. https:example.com/ s:https h:example.com p:/
  201. madeupscheme:example.com/ s:madeupscheme p:example.com/
  202. ftps:example.com/ s:ftps p:example.com/
  203. gopher:example.com/ s:gopher h:example.com p:/
  204. ws:example.com/ s:ws h:example.com p:/
  205. wss:example.com/ s:wss h:example.com p:/
  206. data:example.com/ s:data p:example.com/
  207. javascript:example.com/ s:javascript p:example.com/
  208. mailto:example.com/ s:mailto p:example.com/
  209. # Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html
  210. http:@www.example.com about:blank s:http h:www.example.com p:/
  211. http:/@www.example.com s:http h:www.example.com p:/
  212. http://@www.example.com s:http h:www.example.com p:/
  213. http:a:b@www.example.com s:http u:a pass:b h:www.example.com p:/
  214. http:/a:b@www.example.com s:http u:a pass:b h:www.example.com p:/
  215. http://a:b@www.example.com s:http u:a pass:b h:www.example.com p:/
  216. http://@pple.com s:http h:pple.com p:/
  217. http::b@www.example.com s:http pass:b h:www.example.com p:/
  218. http:/:b@www.example.com s:http pass:b h:www.example.com p:/
  219. http://:b@www.example.com s:http pass:b h:www.example.com p:/
  220. http:/:@/www.example.com
  221. http://user@/www.example.com
  222. http:@/www.example.com
  223. http:/@/www.example.com
  224. http://@/www.example.com
  225. https:@/www.example.com
  226. http:a:b@/www.example.com
  227. http:/a:b@/www.example.com
  228. http://a:b@/www.example.com
  229. http::@/www.example.com
  230. http:a:@www.example.com s:http u:a pass: h:www.example.com p:/
  231. http:/a:@www.example.com s:http u:a pass: h:www.example.com p:/
  232. http://a:@www.example.com s:http u:a pass: h:www.example.com p:/
  233. http://www.@pple.com s:http u:www. h:pple.com p:/
  234. http:@:www.example.com
  235. http:/@:www.example.com
  236. http://@:www.example.com
  237. http://:@www.example.com s:http pass: h:www.example.com p:/