urltestdata.json 93 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212
  1. [
  2. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js",
  3. {
  4. "input": "http://example\t.\norg",
  5. "base": "http://example.org/foo/bar",
  6. "href": "http://example.org/",
  7. "origin": "http://example.org",
  8. "protocol": "http:",
  9. "username": "",
  10. "password": "",
  11. "host": "example.org",
  12. "hostname": "example.org",
  13. "port": "",
  14. "pathname": "/",
  15. "search": "",
  16. "hash": ""
  17. },
  18. {
  19. "input": "http://user:pass@foo:21/bar;par?b#c",
  20. "base": "http://example.org/foo/bar",
  21. "href": "http://user:pass@foo:21/bar;par?b#c",
  22. "origin": "http://foo:21",
  23. "protocol": "http:",
  24. "username": "user",
  25. "password": "pass",
  26. "host": "foo:21",
  27. "hostname": "foo",
  28. "port": "21",
  29. "pathname": "/bar;par",
  30. "search": "?b",
  31. "hash": "#c"
  32. },
  33. {
  34. "input": "http:foo.com",
  35. "base": "http://example.org/foo/bar",
  36. "href": "http://example.org/foo/foo.com",
  37. "origin": "http://example.org",
  38. "protocol": "http:",
  39. "username": "",
  40. "password": "",
  41. "host": "example.org",
  42. "hostname": "example.org",
  43. "port": "",
  44. "pathname": "/foo/foo.com",
  45. "search": "",
  46. "hash": ""
  47. },
  48. {
  49. "input": "\t :foo.com \n",
  50. "base": "http://example.org/foo/bar",
  51. "href": "http://example.org/foo/:foo.com",
  52. "origin": "http://example.org",
  53. "protocol": "http:",
  54. "username": "",
  55. "password": "",
  56. "host": "example.org",
  57. "hostname": "example.org",
  58. "port": "",
  59. "pathname": "/foo/:foo.com",
  60. "search": "",
  61. "hash": ""
  62. },
  63. {
  64. "input": " foo.com ",
  65. "base": "http://example.org/foo/bar",
  66. "href": "http://example.org/foo/foo.com",
  67. "origin": "http://example.org",
  68. "protocol": "http:",
  69. "username": "",
  70. "password": "",
  71. "host": "example.org",
  72. "hostname": "example.org",
  73. "port": "",
  74. "pathname": "/foo/foo.com",
  75. "search": "",
  76. "hash": ""
  77. },
  78. {
  79. "input": "a:\t foo.com",
  80. "base": "http://example.org/foo/bar",
  81. "href": "a: foo.com",
  82. "origin": "null",
  83. "protocol": "a:",
  84. "username": "",
  85. "password": "",
  86. "host": "",
  87. "hostname": "",
  88. "port": "",
  89. "pathname": " foo.com",
  90. "search": "",
  91. "hash": ""
  92. },
  93. {
  94. "input": "http://f:21/ b ? d # e ",
  95. "base": "http://example.org/foo/bar",
  96. "href": "http://f:21/%20b%20?%20d%20# e",
  97. "origin": "http://f:21",
  98. "protocol": "http:",
  99. "username": "",
  100. "password": "",
  101. "host": "f:21",
  102. "hostname": "f",
  103. "port": "21",
  104. "pathname": "/%20b%20",
  105. "search": "?%20d%20",
  106. "hash": "# e"
  107. },
  108. {
  109. "input": "http://f:/c",
  110. "base": "http://example.org/foo/bar",
  111. "href": "http://f/c",
  112. "origin": "http://f",
  113. "protocol": "http:",
  114. "username": "",
  115. "password": "",
  116. "host": "f",
  117. "hostname": "f",
  118. "port": "",
  119. "pathname": "/c",
  120. "search": "",
  121. "hash": ""
  122. },
  123. {
  124. "input": "http://f:0/c",
  125. "base": "http://example.org/foo/bar",
  126. "href": "http://f:0/c",
  127. "origin": "http://f:0",
  128. "protocol": "http:",
  129. "username": "",
  130. "password": "",
  131. "host": "f:0",
  132. "hostname": "f",
  133. "port": "0",
  134. "pathname": "/c",
  135. "search": "",
  136. "hash": ""
  137. },
  138. {
  139. "input": "http://f:00000000000000/c",
  140. "base": "http://example.org/foo/bar",
  141. "href": "http://f:0/c",
  142. "origin": "http://f:0",
  143. "protocol": "http:",
  144. "username": "",
  145. "password": "",
  146. "host": "f:0",
  147. "hostname": "f",
  148. "port": "0",
  149. "pathname": "/c",
  150. "search": "",
  151. "hash": ""
  152. },
  153. {
  154. "input": "http://f:00000000000000000000080/c",
  155. "base": "http://example.org/foo/bar",
  156. "href": "http://f/c",
  157. "origin": "http://f",
  158. "protocol": "http:",
  159. "username": "",
  160. "password": "",
  161. "host": "f",
  162. "hostname": "f",
  163. "port": "",
  164. "pathname": "/c",
  165. "search": "",
  166. "hash": ""
  167. },
  168. {
  169. "input": "http://f:b/c",
  170. "base": "http://example.org/foo/bar",
  171. "failure": true
  172. },
  173. {
  174. "input": "http://f: /c",
  175. "base": "http://example.org/foo/bar",
  176. "failure": true
  177. },
  178. {
  179. "input": "http://f:\n/c",
  180. "base": "http://example.org/foo/bar",
  181. "href": "http://f/c",
  182. "origin": "http://f",
  183. "protocol": "http:",
  184. "username": "",
  185. "password": "",
  186. "host": "f",
  187. "hostname": "f",
  188. "port": "",
  189. "pathname": "/c",
  190. "search": "",
  191. "hash": ""
  192. },
  193. {
  194. "input": "http://f:fifty-two/c",
  195. "base": "http://example.org/foo/bar",
  196. "failure": true
  197. },
  198. {
  199. "input": "http://f:999999/c",
  200. "base": "http://example.org/foo/bar",
  201. "failure": true
  202. },
  203. {
  204. "input": "http://f: 21 / b ? d # e ",
  205. "base": "http://example.org/foo/bar",
  206. "failure": true
  207. },
  208. {
  209. "input": "",
  210. "base": "http://example.org/foo/bar",
  211. "href": "http://example.org/foo/bar",
  212. "origin": "http://example.org",
  213. "protocol": "http:",
  214. "username": "",
  215. "password": "",
  216. "host": "example.org",
  217. "hostname": "example.org",
  218. "port": "",
  219. "pathname": "/foo/bar",
  220. "search": "",
  221. "hash": ""
  222. },
  223. {
  224. "input": " \t",
  225. "base": "http://example.org/foo/bar",
  226. "href": "http://example.org/foo/bar",
  227. "origin": "http://example.org",
  228. "protocol": "http:",
  229. "username": "",
  230. "password": "",
  231. "host": "example.org",
  232. "hostname": "example.org",
  233. "port": "",
  234. "pathname": "/foo/bar",
  235. "search": "",
  236. "hash": ""
  237. },
  238. {
  239. "input": ":foo.com/",
  240. "base": "http://example.org/foo/bar",
  241. "href": "http://example.org/foo/:foo.com/",
  242. "origin": "http://example.org",
  243. "protocol": "http:",
  244. "username": "",
  245. "password": "",
  246. "host": "example.org",
  247. "hostname": "example.org",
  248. "port": "",
  249. "pathname": "/foo/:foo.com/",
  250. "search": "",
  251. "hash": ""
  252. },
  253. {
  254. "input": ":foo.com\\",
  255. "base": "http://example.org/foo/bar",
  256. "href": "http://example.org/foo/:foo.com/",
  257. "origin": "http://example.org",
  258. "protocol": "http:",
  259. "username": "",
  260. "password": "",
  261. "host": "example.org",
  262. "hostname": "example.org",
  263. "port": "",
  264. "pathname": "/foo/:foo.com/",
  265. "search": "",
  266. "hash": ""
  267. },
  268. {
  269. "input": ":",
  270. "base": "http://example.org/foo/bar",
  271. "href": "http://example.org/foo/:",
  272. "origin": "http://example.org",
  273. "protocol": "http:",
  274. "username": "",
  275. "password": "",
  276. "host": "example.org",
  277. "hostname": "example.org",
  278. "port": "",
  279. "pathname": "/foo/:",
  280. "search": "",
  281. "hash": ""
  282. },
  283. {
  284. "input": ":a",
  285. "base": "http://example.org/foo/bar",
  286. "href": "http://example.org/foo/:a",
  287. "origin": "http://example.org",
  288. "protocol": "http:",
  289. "username": "",
  290. "password": "",
  291. "host": "example.org",
  292. "hostname": "example.org",
  293. "port": "",
  294. "pathname": "/foo/:a",
  295. "search": "",
  296. "hash": ""
  297. },
  298. {
  299. "input": ":/",
  300. "base": "http://example.org/foo/bar",
  301. "href": "http://example.org/foo/:/",
  302. "origin": "http://example.org",
  303. "protocol": "http:",
  304. "username": "",
  305. "password": "",
  306. "host": "example.org",
  307. "hostname": "example.org",
  308. "port": "",
  309. "pathname": "/foo/:/",
  310. "search": "",
  311. "hash": ""
  312. },
  313. {
  314. "input": ":\\",
  315. "base": "http://example.org/foo/bar",
  316. "href": "http://example.org/foo/:/",
  317. "origin": "http://example.org",
  318. "protocol": "http:",
  319. "username": "",
  320. "password": "",
  321. "host": "example.org",
  322. "hostname": "example.org",
  323. "port": "",
  324. "pathname": "/foo/:/",
  325. "search": "",
  326. "hash": ""
  327. },
  328. {
  329. "input": ":#",
  330. "base": "http://example.org/foo/bar",
  331. "href": "http://example.org/foo/:#",
  332. "origin": "http://example.org",
  333. "protocol": "http:",
  334. "username": "",
  335. "password": "",
  336. "host": "example.org",
  337. "hostname": "example.org",
  338. "port": "",
  339. "pathname": "/foo/:",
  340. "search": "",
  341. "hash": ""
  342. },
  343. {
  344. "input": "#",
  345. "base": "http://example.org/foo/bar",
  346. "href": "http://example.org/foo/bar#",
  347. "origin": "http://example.org",
  348. "protocol": "http:",
  349. "username": "",
  350. "password": "",
  351. "host": "example.org",
  352. "hostname": "example.org",
  353. "port": "",
  354. "pathname": "/foo/bar",
  355. "search": "",
  356. "hash": ""
  357. },
  358. {
  359. "input": "#/",
  360. "base": "http://example.org/foo/bar",
  361. "href": "http://example.org/foo/bar#/",
  362. "origin": "http://example.org",
  363. "protocol": "http:",
  364. "username": "",
  365. "password": "",
  366. "host": "example.org",
  367. "hostname": "example.org",
  368. "port": "",
  369. "pathname": "/foo/bar",
  370. "search": "",
  371. "hash": "#/"
  372. },
  373. {
  374. "input": "#\\",
  375. "base": "http://example.org/foo/bar",
  376. "href": "http://example.org/foo/bar#\\",
  377. "origin": "http://example.org",
  378. "protocol": "http:",
  379. "username": "",
  380. "password": "",
  381. "host": "example.org",
  382. "hostname": "example.org",
  383. "port": "",
  384. "pathname": "/foo/bar",
  385. "search": "",
  386. "hash": "#\\"
  387. },
  388. {
  389. "input": "#;?",
  390. "base": "http://example.org/foo/bar",
  391. "href": "http://example.org/foo/bar#;?",
  392. "origin": "http://example.org",
  393. "protocol": "http:",
  394. "username": "",
  395. "password": "",
  396. "host": "example.org",
  397. "hostname": "example.org",
  398. "port": "",
  399. "pathname": "/foo/bar",
  400. "search": "",
  401. "hash": "#;?"
  402. },
  403. {
  404. "input": "?",
  405. "base": "http://example.org/foo/bar",
  406. "href": "http://example.org/foo/bar?",
  407. "origin": "http://example.org",
  408. "protocol": "http:",
  409. "username": "",
  410. "password": "",
  411. "host": "example.org",
  412. "hostname": "example.org",
  413. "port": "",
  414. "pathname": "/foo/bar",
  415. "search": "",
  416. "hash": ""
  417. },
  418. {
  419. "input": "/",
  420. "base": "http://example.org/foo/bar",
  421. "href": "http://example.org/",
  422. "origin": "http://example.org",
  423. "protocol": "http:",
  424. "username": "",
  425. "password": "",
  426. "host": "example.org",
  427. "hostname": "example.org",
  428. "port": "",
  429. "pathname": "/",
  430. "search": "",
  431. "hash": ""
  432. },
  433. {
  434. "input": ":23",
  435. "base": "http://example.org/foo/bar",
  436. "href": "http://example.org/foo/:23",
  437. "origin": "http://example.org",
  438. "protocol": "http:",
  439. "username": "",
  440. "password": "",
  441. "host": "example.org",
  442. "hostname": "example.org",
  443. "port": "",
  444. "pathname": "/foo/:23",
  445. "search": "",
  446. "hash": ""
  447. },
  448. {
  449. "input": "/:23",
  450. "base": "http://example.org/foo/bar",
  451. "href": "http://example.org/:23",
  452. "origin": "http://example.org",
  453. "protocol": "http:",
  454. "username": "",
  455. "password": "",
  456. "host": "example.org",
  457. "hostname": "example.org",
  458. "port": "",
  459. "pathname": "/:23",
  460. "search": "",
  461. "hash": ""
  462. },
  463. {
  464. "input": "::",
  465. "base": "http://example.org/foo/bar",
  466. "href": "http://example.org/foo/::",
  467. "origin": "http://example.org",
  468. "protocol": "http:",
  469. "username": "",
  470. "password": "",
  471. "host": "example.org",
  472. "hostname": "example.org",
  473. "port": "",
  474. "pathname": "/foo/::",
  475. "search": "",
  476. "hash": ""
  477. },
  478. {
  479. "input": "::23",
  480. "base": "http://example.org/foo/bar",
  481. "href": "http://example.org/foo/::23",
  482. "origin": "http://example.org",
  483. "protocol": "http:",
  484. "username": "",
  485. "password": "",
  486. "host": "example.org",
  487. "hostname": "example.org",
  488. "port": "",
  489. "pathname": "/foo/::23",
  490. "search": "",
  491. "hash": ""
  492. },
  493. {
  494. "input": "foo://",
  495. "base": "http://example.org/foo/bar",
  496. "href": "foo:///",
  497. "origin": "null",
  498. "protocol": "foo:",
  499. "username": "",
  500. "password": "",
  501. "host": "",
  502. "hostname": "",
  503. "port": "",
  504. "pathname": "/",
  505. "search": "",
  506. "hash": ""
  507. },
  508. {
  509. "input": "http://a:b@c:29/d",
  510. "base": "http://example.org/foo/bar",
  511. "href": "http://a:b@c:29/d",
  512. "origin": "http://c:29",
  513. "protocol": "http:",
  514. "username": "a",
  515. "password": "b",
  516. "host": "c:29",
  517. "hostname": "c",
  518. "port": "29",
  519. "pathname": "/d",
  520. "search": "",
  521. "hash": ""
  522. },
  523. {
  524. "input": "http::@c:29",
  525. "base": "http://example.org/foo/bar",
  526. "href": "http://example.org/foo/:@c:29",
  527. "origin": "http://example.org",
  528. "protocol": "http:",
  529. "username": "",
  530. "password": "",
  531. "host": "example.org",
  532. "hostname": "example.org",
  533. "port": "",
  534. "pathname": "/foo/:@c:29",
  535. "search": "",
  536. "hash": ""
  537. },
  538. {
  539. "input": "http://&a:foo(b]c@d:2/",
  540. "base": "http://example.org/foo/bar",
  541. "href": "http://&a:foo(b%5Dc@d:2/",
  542. "origin": "http://d:2",
  543. "protocol": "http:",
  544. "username": "&a",
  545. "password": "foo(b%5Dc",
  546. "host": "d:2",
  547. "hostname": "d",
  548. "port": "2",
  549. "pathname": "/",
  550. "search": "",
  551. "hash": ""
  552. },
  553. {
  554. "input": "http://::@c@d:2",
  555. "base": "http://example.org/foo/bar",
  556. "href": "http://:%3A%40c@d:2/",
  557. "origin": "http://d:2",
  558. "protocol": "http:",
  559. "username": "",
  560. "password": "%3A%40c",
  561. "host": "d:2",
  562. "hostname": "d",
  563. "port": "2",
  564. "pathname": "/",
  565. "search": "",
  566. "hash": ""
  567. },
  568. {
  569. "input": "http://foo.com:b@d/",
  570. "base": "http://example.org/foo/bar",
  571. "href": "http://foo.com:b@d/",
  572. "origin": "http://d",
  573. "protocol": "http:",
  574. "username": "foo.com",
  575. "password": "b",
  576. "host": "d",
  577. "hostname": "d",
  578. "port": "",
  579. "pathname": "/",
  580. "search": "",
  581. "hash": ""
  582. },
  583. {
  584. "input": "http://foo.com/\\@",
  585. "base": "http://example.org/foo/bar",
  586. "href": "http://foo.com//@",
  587. "origin": "http://foo.com",
  588. "protocol": "http:",
  589. "username": "",
  590. "password": "",
  591. "host": "foo.com",
  592. "hostname": "foo.com",
  593. "port": "",
  594. "pathname": "//@",
  595. "search": "",
  596. "hash": ""
  597. },
  598. {
  599. "input": "http:\\\\foo.com\\",
  600. "base": "http://example.org/foo/bar",
  601. "href": "http://foo.com/",
  602. "origin": "http://foo.com",
  603. "protocol": "http:",
  604. "username": "",
  605. "password": "",
  606. "host": "foo.com",
  607. "hostname": "foo.com",
  608. "port": "",
  609. "pathname": "/",
  610. "search": "",
  611. "hash": ""
  612. },
  613. {
  614. "input": "http:\\\\a\\b:c\\d@foo.com\\",
  615. "base": "http://example.org/foo/bar",
  616. "href": "http://a/b:c/d@foo.com/",
  617. "origin": "http://a",
  618. "protocol": "http:",
  619. "username": "",
  620. "password": "",
  621. "host": "a",
  622. "hostname": "a",
  623. "port": "",
  624. "pathname": "/b:c/d@foo.com/",
  625. "search": "",
  626. "hash": ""
  627. },
  628. {
  629. "input": "foo:/",
  630. "base": "http://example.org/foo/bar",
  631. "href": "foo:/",
  632. "origin": "null",
  633. "protocol": "foo:",
  634. "username": "",
  635. "password": "",
  636. "host": "",
  637. "hostname": "",
  638. "port": "",
  639. "pathname": "/",
  640. "search": "",
  641. "hash": ""
  642. },
  643. {
  644. "input": "foo:/bar.com/",
  645. "base": "http://example.org/foo/bar",
  646. "href": "foo:/bar.com/",
  647. "origin": "null",
  648. "protocol": "foo:",
  649. "username": "",
  650. "password": "",
  651. "host": "",
  652. "hostname": "",
  653. "port": "",
  654. "pathname": "/bar.com/",
  655. "search": "",
  656. "hash": ""
  657. },
  658. {
  659. "input": "foo://///////",
  660. "base": "http://example.org/foo/bar",
  661. "href": "foo://///////",
  662. "origin": "null",
  663. "protocol": "foo:",
  664. "username": "",
  665. "password": "",
  666. "host": "",
  667. "hostname": "",
  668. "port": "",
  669. "pathname": "///////",
  670. "search": "",
  671. "hash": ""
  672. },
  673. {
  674. "input": "foo://///////bar.com/",
  675. "base": "http://example.org/foo/bar",
  676. "href": "foo://///////bar.com/",
  677. "origin": "null",
  678. "protocol": "foo:",
  679. "username": "",
  680. "password": "",
  681. "host": "",
  682. "hostname": "",
  683. "port": "",
  684. "pathname": "///////bar.com/",
  685. "search": "",
  686. "hash": ""
  687. },
  688. {
  689. "input": "foo:////://///",
  690. "base": "http://example.org/foo/bar",
  691. "href": "foo:////://///",
  692. "origin": "null",
  693. "protocol": "foo:",
  694. "username": "",
  695. "password": "",
  696. "host": "",
  697. "hostname": "",
  698. "port": "",
  699. "pathname": "//://///",
  700. "search": "",
  701. "hash": ""
  702. },
  703. {
  704. "input": "c:/foo",
  705. "base": "http://example.org/foo/bar",
  706. "href": "c:/foo",
  707. "origin": "null",
  708. "protocol": "c:",
  709. "username": "",
  710. "password": "",
  711. "host": "",
  712. "hostname": "",
  713. "port": "",
  714. "pathname": "/foo",
  715. "search": "",
  716. "hash": ""
  717. },
  718. {
  719. "input": "//foo/bar",
  720. "base": "http://example.org/foo/bar",
  721. "href": "http://foo/bar",
  722. "origin": "http://foo",
  723. "protocol": "http:",
  724. "username": "",
  725. "password": "",
  726. "host": "foo",
  727. "hostname": "foo",
  728. "port": "",
  729. "pathname": "/bar",
  730. "search": "",
  731. "hash": ""
  732. },
  733. {
  734. "input": "http://foo/path;a??e#f#g",
  735. "base": "http://example.org/foo/bar",
  736. "href": "http://foo/path;a??e#f#g",
  737. "origin": "http://foo",
  738. "protocol": "http:",
  739. "username": "",
  740. "password": "",
  741. "host": "foo",
  742. "hostname": "foo",
  743. "port": "",
  744. "pathname": "/path;a",
  745. "search": "??e",
  746. "hash": "#f#g"
  747. },
  748. {
  749. "input": "http://foo/abcd?efgh?ijkl",
  750. "base": "http://example.org/foo/bar",
  751. "href": "http://foo/abcd?efgh?ijkl",
  752. "origin": "http://foo",
  753. "protocol": "http:",
  754. "username": "",
  755. "password": "",
  756. "host": "foo",
  757. "hostname": "foo",
  758. "port": "",
  759. "pathname": "/abcd",
  760. "search": "?efgh?ijkl",
  761. "hash": ""
  762. },
  763. {
  764. "input": "http://foo/abcd#foo?bar",
  765. "base": "http://example.org/foo/bar",
  766. "href": "http://foo/abcd#foo?bar",
  767. "origin": "http://foo",
  768. "protocol": "http:",
  769. "username": "",
  770. "password": "",
  771. "host": "foo",
  772. "hostname": "foo",
  773. "port": "",
  774. "pathname": "/abcd",
  775. "search": "",
  776. "hash": "#foo?bar"
  777. },
  778. {
  779. "input": "[61:24:74]:98",
  780. "base": "http://example.org/foo/bar",
  781. "href": "http://example.org/foo/[61:24:74]:98",
  782. "origin": "http://example.org",
  783. "protocol": "http:",
  784. "username": "",
  785. "password": "",
  786. "host": "example.org",
  787. "hostname": "example.org",
  788. "port": "",
  789. "pathname": "/foo/[61:24:74]:98",
  790. "search": "",
  791. "hash": ""
  792. },
  793. {
  794. "input": "http:[61:27]/:foo",
  795. "base": "http://example.org/foo/bar",
  796. "href": "http://example.org/foo/[61:27]/:foo",
  797. "origin": "http://example.org",
  798. "protocol": "http:",
  799. "username": "",
  800. "password": "",
  801. "host": "example.org",
  802. "hostname": "example.org",
  803. "port": "",
  804. "pathname": "/foo/[61:27]/:foo",
  805. "search": "",
  806. "hash": ""
  807. },
  808. {
  809. "input": "http://[1::2]:3:4",
  810. "base": "http://example.org/foo/bar",
  811. "failure": true
  812. },
  813. {
  814. "input": "http://2001::1",
  815. "base": "http://example.org/foo/bar",
  816. "failure": true
  817. },
  818. {
  819. "input": "http://2001::1]",
  820. "base": "http://example.org/foo/bar",
  821. "failure": true
  822. },
  823. {
  824. "input": "http://2001::1]:80",
  825. "base": "http://example.org/foo/bar",
  826. "failure": true
  827. },
  828. {
  829. "input": "http://[2001::1]",
  830. "base": "http://example.org/foo/bar",
  831. "href": "http://[2001::1]/",
  832. "origin": "http://[2001::1]",
  833. "protocol": "http:",
  834. "username": "",
  835. "password": "",
  836. "host": "[2001::1]",
  837. "hostname": "[2001::1]",
  838. "port": "",
  839. "pathname": "/",
  840. "search": "",
  841. "hash": ""
  842. },
  843. {
  844. "input": "http://[2001::1]:80",
  845. "base": "http://example.org/foo/bar",
  846. "href": "http://[2001::1]/",
  847. "origin": "http://[2001::1]",
  848. "protocol": "http:",
  849. "username": "",
  850. "password": "",
  851. "host": "[2001::1]",
  852. "hostname": "[2001::1]",
  853. "port": "",
  854. "pathname": "/",
  855. "search": "",
  856. "hash": ""
  857. },
  858. {
  859. "input": "http:/example.com/",
  860. "base": "http://example.org/foo/bar",
  861. "href": "http://example.org/example.com/",
  862. "origin": "http://example.org",
  863. "protocol": "http:",
  864. "username": "",
  865. "password": "",
  866. "host": "example.org",
  867. "hostname": "example.org",
  868. "port": "",
  869. "pathname": "/example.com/",
  870. "search": "",
  871. "hash": ""
  872. },
  873. {
  874. "input": "ftp:/example.com/",
  875. "base": "http://example.org/foo/bar",
  876. "href": "ftp://example.com/",
  877. "origin": "ftp://example.com",
  878. "protocol": "ftp:",
  879. "username": "",
  880. "password": "",
  881. "host": "example.com",
  882. "hostname": "example.com",
  883. "port": "",
  884. "pathname": "/",
  885. "search": "",
  886. "hash": ""
  887. },
  888. {
  889. "input": "https:/example.com/",
  890. "base": "http://example.org/foo/bar",
  891. "href": "https://example.com/",
  892. "origin": "https://example.com",
  893. "protocol": "https:",
  894. "username": "",
  895. "password": "",
  896. "host": "example.com",
  897. "hostname": "example.com",
  898. "port": "",
  899. "pathname": "/",
  900. "search": "",
  901. "hash": ""
  902. },
  903. {
  904. "input": "madeupscheme:/example.com/",
  905. "base": "http://example.org/foo/bar",
  906. "href": "madeupscheme:/example.com/",
  907. "origin": "null",
  908. "protocol": "madeupscheme:",
  909. "username": "",
  910. "password": "",
  911. "host": "",
  912. "hostname": "",
  913. "port": "",
  914. "pathname": "/example.com/",
  915. "search": "",
  916. "hash": ""
  917. },
  918. {
  919. "input": "file:/example.com/",
  920. "base": "http://example.org/foo/bar",
  921. "href": "file:///example.com/",
  922. "protocol": "file:",
  923. "username": "",
  924. "password": "",
  925. "host": "",
  926. "hostname": "",
  927. "port": "",
  928. "pathname": "/example.com/",
  929. "search": "",
  930. "hash": ""
  931. },
  932. {
  933. "input": "ftps:/example.com/",
  934. "base": "http://example.org/foo/bar",
  935. "href": "ftps:/example.com/",
  936. "origin": "null",
  937. "protocol": "ftps:",
  938. "username": "",
  939. "password": "",
  940. "host": "",
  941. "hostname": "",
  942. "port": "",
  943. "pathname": "/example.com/",
  944. "search": "",
  945. "hash": ""
  946. },
  947. {
  948. "input": "gopher:/example.com/",
  949. "base": "http://example.org/foo/bar",
  950. "href": "gopher://example.com/",
  951. "origin": "gopher://example.com",
  952. "protocol": "gopher:",
  953. "username": "",
  954. "password": "",
  955. "host": "example.com",
  956. "hostname": "example.com",
  957. "port": "",
  958. "pathname": "/",
  959. "search": "",
  960. "hash": ""
  961. },
  962. {
  963. "input": "ws:/example.com/",
  964. "base": "http://example.org/foo/bar",
  965. "href": "ws://example.com/",
  966. "origin": "ws://example.com",
  967. "protocol": "ws:",
  968. "username": "",
  969. "password": "",
  970. "host": "example.com",
  971. "hostname": "example.com",
  972. "port": "",
  973. "pathname": "/",
  974. "search": "",
  975. "hash": ""
  976. },
  977. {
  978. "input": "wss:/example.com/",
  979. "base": "http://example.org/foo/bar",
  980. "href": "wss://example.com/",
  981. "origin": "wss://example.com",
  982. "protocol": "wss:",
  983. "username": "",
  984. "password": "",
  985. "host": "example.com",
  986. "hostname": "example.com",
  987. "port": "",
  988. "pathname": "/",
  989. "search": "",
  990. "hash": ""
  991. },
  992. {
  993. "input": "data:/example.com/",
  994. "base": "http://example.org/foo/bar",
  995. "href": "data:/example.com/",
  996. "origin": "null",
  997. "protocol": "data:",
  998. "username": "",
  999. "password": "",
  1000. "host": "",
  1001. "hostname": "",
  1002. "port": "",
  1003. "pathname": "/example.com/",
  1004. "search": "",
  1005. "hash": ""
  1006. },
  1007. {
  1008. "input": "javascript:/example.com/",
  1009. "base": "http://example.org/foo/bar",
  1010. "href": "javascript:/example.com/",
  1011. "origin": "null",
  1012. "protocol": "javascript:",
  1013. "username": "",
  1014. "password": "",
  1015. "host": "",
  1016. "hostname": "",
  1017. "port": "",
  1018. "pathname": "/example.com/",
  1019. "search": "",
  1020. "hash": ""
  1021. },
  1022. {
  1023. "input": "mailto:/example.com/",
  1024. "base": "http://example.org/foo/bar",
  1025. "href": "mailto:/example.com/",
  1026. "origin": "null",
  1027. "protocol": "mailto:",
  1028. "username": "",
  1029. "password": "",
  1030. "host": "",
  1031. "hostname": "",
  1032. "port": "",
  1033. "pathname": "/example.com/",
  1034. "search": "",
  1035. "hash": ""
  1036. },
  1037. {
  1038. "input": "http:example.com/",
  1039. "base": "http://example.org/foo/bar",
  1040. "href": "http://example.org/foo/example.com/",
  1041. "origin": "http://example.org",
  1042. "protocol": "http:",
  1043. "username": "",
  1044. "password": "",
  1045. "host": "example.org",
  1046. "hostname": "example.org",
  1047. "port": "",
  1048. "pathname": "/foo/example.com/",
  1049. "search": "",
  1050. "hash": ""
  1051. },
  1052. {
  1053. "input": "ftp:example.com/",
  1054. "base": "http://example.org/foo/bar",
  1055. "href": "ftp://example.com/",
  1056. "origin": "ftp://example.com",
  1057. "protocol": "ftp:",
  1058. "username": "",
  1059. "password": "",
  1060. "host": "example.com",
  1061. "hostname": "example.com",
  1062. "port": "",
  1063. "pathname": "/",
  1064. "search": "",
  1065. "hash": ""
  1066. },
  1067. {
  1068. "input": "https:example.com/",
  1069. "base": "http://example.org/foo/bar",
  1070. "href": "https://example.com/",
  1071. "origin": "https://example.com",
  1072. "protocol": "https:",
  1073. "username": "",
  1074. "password": "",
  1075. "host": "example.com",
  1076. "hostname": "example.com",
  1077. "port": "",
  1078. "pathname": "/",
  1079. "search": "",
  1080. "hash": ""
  1081. },
  1082. {
  1083. "input": "madeupscheme:example.com/",
  1084. "base": "http://example.org/foo/bar",
  1085. "href": "madeupscheme:example.com/",
  1086. "origin": "null",
  1087. "protocol": "madeupscheme:",
  1088. "username": "",
  1089. "password": "",
  1090. "host": "",
  1091. "hostname": "",
  1092. "port": "",
  1093. "pathname": "example.com/",
  1094. "search": "",
  1095. "hash": ""
  1096. },
  1097. {
  1098. "input": "ftps:example.com/",
  1099. "base": "http://example.org/foo/bar",
  1100. "href": "ftps:example.com/",
  1101. "origin": "null",
  1102. "protocol": "ftps:",
  1103. "username": "",
  1104. "password": "",
  1105. "host": "",
  1106. "hostname": "",
  1107. "port": "",
  1108. "pathname": "example.com/",
  1109. "search": "",
  1110. "hash": ""
  1111. },
  1112. {
  1113. "input": "gopher:example.com/",
  1114. "base": "http://example.org/foo/bar",
  1115. "href": "gopher://example.com/",
  1116. "origin": "gopher://example.com",
  1117. "protocol": "gopher:",
  1118. "username": "",
  1119. "password": "",
  1120. "host": "example.com",
  1121. "hostname": "example.com",
  1122. "port": "",
  1123. "pathname": "/",
  1124. "search": "",
  1125. "hash": ""
  1126. },
  1127. {
  1128. "input": "ws:example.com/",
  1129. "base": "http://example.org/foo/bar",
  1130. "href": "ws://example.com/",
  1131. "origin": "ws://example.com",
  1132. "protocol": "ws:",
  1133. "username": "",
  1134. "password": "",
  1135. "host": "example.com",
  1136. "hostname": "example.com",
  1137. "port": "",
  1138. "pathname": "/",
  1139. "search": "",
  1140. "hash": ""
  1141. },
  1142. {
  1143. "input": "wss:example.com/",
  1144. "base": "http://example.org/foo/bar",
  1145. "href": "wss://example.com/",
  1146. "origin": "wss://example.com",
  1147. "protocol": "wss:",
  1148. "username": "",
  1149. "password": "",
  1150. "host": "example.com",
  1151. "hostname": "example.com",
  1152. "port": "",
  1153. "pathname": "/",
  1154. "search": "",
  1155. "hash": ""
  1156. },
  1157. {
  1158. "input": "data:example.com/",
  1159. "base": "http://example.org/foo/bar",
  1160. "href": "data:example.com/",
  1161. "origin": "null",
  1162. "protocol": "data:",
  1163. "username": "",
  1164. "password": "",
  1165. "host": "",
  1166. "hostname": "",
  1167. "port": "",
  1168. "pathname": "example.com/",
  1169. "search": "",
  1170. "hash": ""
  1171. },
  1172. {
  1173. "input": "javascript:example.com/",
  1174. "base": "http://example.org/foo/bar",
  1175. "href": "javascript:example.com/",
  1176. "origin": "null",
  1177. "protocol": "javascript:",
  1178. "username": "",
  1179. "password": "",
  1180. "host": "",
  1181. "hostname": "",
  1182. "port": "",
  1183. "pathname": "example.com/",
  1184. "search": "",
  1185. "hash": ""
  1186. },
  1187. {
  1188. "input": "mailto:example.com/",
  1189. "base": "http://example.org/foo/bar",
  1190. "href": "mailto:example.com/",
  1191. "origin": "null",
  1192. "protocol": "mailto:",
  1193. "username": "",
  1194. "password": "",
  1195. "host": "",
  1196. "hostname": "",
  1197. "port": "",
  1198. "pathname": "example.com/",
  1199. "search": "",
  1200. "hash": ""
  1201. },
  1202. {
  1203. "input": "/a/b/c",
  1204. "base": "http://example.org/foo/bar",
  1205. "href": "http://example.org/a/b/c",
  1206. "origin": "http://example.org",
  1207. "protocol": "http:",
  1208. "username": "",
  1209. "password": "",
  1210. "host": "example.org",
  1211. "hostname": "example.org",
  1212. "port": "",
  1213. "pathname": "/a/b/c",
  1214. "search": "",
  1215. "hash": ""
  1216. },
  1217. {
  1218. "input": "/a/ /c",
  1219. "base": "http://example.org/foo/bar",
  1220. "href": "http://example.org/a/%20/c",
  1221. "origin": "http://example.org",
  1222. "protocol": "http:",
  1223. "username": "",
  1224. "password": "",
  1225. "host": "example.org",
  1226. "hostname": "example.org",
  1227. "port": "",
  1228. "pathname": "/a/%20/c",
  1229. "search": "",
  1230. "hash": ""
  1231. },
  1232. {
  1233. "input": "/a%2fc",
  1234. "base": "http://example.org/foo/bar",
  1235. "href": "http://example.org/a%2fc",
  1236. "origin": "http://example.org",
  1237. "protocol": "http:",
  1238. "username": "",
  1239. "password": "",
  1240. "host": "example.org",
  1241. "hostname": "example.org",
  1242. "port": "",
  1243. "pathname": "/a%2fc",
  1244. "search": "",
  1245. "hash": ""
  1246. },
  1247. {
  1248. "input": "/a/%2f/c",
  1249. "base": "http://example.org/foo/bar",
  1250. "href": "http://example.org/a/%2f/c",
  1251. "origin": "http://example.org",
  1252. "protocol": "http:",
  1253. "username": "",
  1254. "password": "",
  1255. "host": "example.org",
  1256. "hostname": "example.org",
  1257. "port": "",
  1258. "pathname": "/a/%2f/c",
  1259. "search": "",
  1260. "hash": ""
  1261. },
  1262. {
  1263. "input": "#β",
  1264. "base": "http://example.org/foo/bar",
  1265. "href": "http://example.org/foo/bar#β",
  1266. "origin": "http://example.org",
  1267. "protocol": "http:",
  1268. "username": "",
  1269. "password": "",
  1270. "host": "example.org",
  1271. "hostname": "example.org",
  1272. "port": "",
  1273. "pathname": "/foo/bar",
  1274. "search": "",
  1275. "hash": "#β"
  1276. },
  1277. {
  1278. "input": "data:text/html,test#test",
  1279. "base": "http://example.org/foo/bar",
  1280. "href": "data:text/html,test#test",
  1281. "origin": "null",
  1282. "protocol": "data:",
  1283. "username": "",
  1284. "password": "",
  1285. "host": "",
  1286. "hostname": "",
  1287. "port": "",
  1288. "pathname": "text/html,test",
  1289. "search": "",
  1290. "hash": "#test"
  1291. },
  1292. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
  1293. {
  1294. "input": "file:c:\\foo\\bar.html",
  1295. "base": "file:///tmp/mock/path",
  1296. "href": "file:///c:/foo/bar.html",
  1297. "protocol": "file:",
  1298. "username": "",
  1299. "password": "",
  1300. "host": "",
  1301. "hostname": "",
  1302. "port": "",
  1303. "pathname": "/c:/foo/bar.html",
  1304. "search": "",
  1305. "hash": ""
  1306. },
  1307. {
  1308. "input": " File:c|////foo\\bar.html",
  1309. "base": "file:///tmp/mock/path",
  1310. "href": "file:///c:////foo/bar.html",
  1311. "protocol": "file:",
  1312. "username": "",
  1313. "password": "",
  1314. "host": "",
  1315. "hostname": "",
  1316. "port": "",
  1317. "pathname": "/c:////foo/bar.html",
  1318. "search": "",
  1319. "hash": ""
  1320. },
  1321. {
  1322. "input": "C|/foo/bar",
  1323. "base": "file:///tmp/mock/path",
  1324. "href": "file:///C:/foo/bar",
  1325. "protocol": "file:",
  1326. "username": "",
  1327. "password": "",
  1328. "host": "",
  1329. "hostname": "",
  1330. "port": "",
  1331. "pathname": "/C:/foo/bar",
  1332. "search": "",
  1333. "hash": ""
  1334. },
  1335. {
  1336. "input": "/C|\\foo\\bar",
  1337. "base": "file:///tmp/mock/path",
  1338. "href": "file:///C:/foo/bar",
  1339. "protocol": "file:",
  1340. "username": "",
  1341. "password": "",
  1342. "host": "",
  1343. "hostname": "",
  1344. "port": "",
  1345. "pathname": "/C:/foo/bar",
  1346. "search": "",
  1347. "hash": ""
  1348. },
  1349. {
  1350. "input": "//C|/foo/bar",
  1351. "base": "file:///tmp/mock/path",
  1352. "href": "file:///C:/foo/bar",
  1353. "protocol": "file:",
  1354. "username": "",
  1355. "password": "",
  1356. "host": "",
  1357. "hostname": "",
  1358. "port": "",
  1359. "pathname": "/C:/foo/bar",
  1360. "search": "",
  1361. "hash": ""
  1362. },
  1363. {
  1364. "input": "//server/file",
  1365. "base": "file:///tmp/mock/path",
  1366. "href": "file://server/file",
  1367. "protocol": "file:",
  1368. "username": "",
  1369. "password": "",
  1370. "host": "server",
  1371. "hostname": "server",
  1372. "port": "",
  1373. "pathname": "/file",
  1374. "search": "",
  1375. "hash": ""
  1376. },
  1377. {
  1378. "input": "\\\\server\\file",
  1379. "base": "file:///tmp/mock/path",
  1380. "href": "file://server/file",
  1381. "protocol": "file:",
  1382. "username": "",
  1383. "password": "",
  1384. "host": "server",
  1385. "hostname": "server",
  1386. "port": "",
  1387. "pathname": "/file",
  1388. "search": "",
  1389. "hash": ""
  1390. },
  1391. {
  1392. "input": "/\\server/file",
  1393. "base": "file:///tmp/mock/path",
  1394. "href": "file://server/file",
  1395. "protocol": "file:",
  1396. "username": "",
  1397. "password": "",
  1398. "host": "server",
  1399. "hostname": "server",
  1400. "port": "",
  1401. "pathname": "/file",
  1402. "search": "",
  1403. "hash": ""
  1404. },
  1405. {
  1406. "input": "file:///foo/bar.txt",
  1407. "base": "file:///tmp/mock/path",
  1408. "href": "file:///foo/bar.txt",
  1409. "protocol": "file:",
  1410. "username": "",
  1411. "password": "",
  1412. "host": "",
  1413. "hostname": "",
  1414. "port": "",
  1415. "pathname": "/foo/bar.txt",
  1416. "search": "",
  1417. "hash": ""
  1418. },
  1419. {
  1420. "input": "file:///home/me",
  1421. "base": "file:///tmp/mock/path",
  1422. "href": "file:///home/me",
  1423. "protocol": "file:",
  1424. "username": "",
  1425. "password": "",
  1426. "host": "",
  1427. "hostname": "",
  1428. "port": "",
  1429. "pathname": "/home/me",
  1430. "search": "",
  1431. "hash": ""
  1432. },
  1433. {
  1434. "input": "//",
  1435. "base": "file:///tmp/mock/path",
  1436. "href": "file:///",
  1437. "protocol": "file:",
  1438. "username": "",
  1439. "password": "",
  1440. "host": "",
  1441. "hostname": "",
  1442. "port": "",
  1443. "pathname": "/",
  1444. "search": "",
  1445. "hash": ""
  1446. },
  1447. {
  1448. "input": "///",
  1449. "base": "file:///tmp/mock/path",
  1450. "href": "file:///",
  1451. "protocol": "file:",
  1452. "username": "",
  1453. "password": "",
  1454. "host": "",
  1455. "hostname": "",
  1456. "port": "",
  1457. "pathname": "/",
  1458. "search": "",
  1459. "hash": ""
  1460. },
  1461. {
  1462. "input": "///test",
  1463. "base": "file:///tmp/mock/path",
  1464. "href": "file:///test",
  1465. "protocol": "file:",
  1466. "username": "",
  1467. "password": "",
  1468. "host": "",
  1469. "hostname": "",
  1470. "port": "",
  1471. "pathname": "/test",
  1472. "search": "",
  1473. "hash": ""
  1474. },
  1475. {
  1476. "input": "file://test",
  1477. "base": "file:///tmp/mock/path",
  1478. "href": "file://test/",
  1479. "protocol": "file:",
  1480. "username": "",
  1481. "password": "",
  1482. "host": "test",
  1483. "hostname": "test",
  1484. "port": "",
  1485. "pathname": "/",
  1486. "search": "",
  1487. "hash": ""
  1488. },
  1489. {
  1490. "input": "file://localhost",
  1491. "base": "file:///tmp/mock/path",
  1492. "href": "file:///",
  1493. "protocol": "file:",
  1494. "username": "",
  1495. "password": "",
  1496. "host": "",
  1497. "hostname": "",
  1498. "port": "",
  1499. "pathname": "/",
  1500. "search": "",
  1501. "hash": ""
  1502. },
  1503. {
  1504. "input": "file://localhost/",
  1505. "base": "file:///tmp/mock/path",
  1506. "href": "file:///",
  1507. "protocol": "file:",
  1508. "username": "",
  1509. "password": "",
  1510. "host": "",
  1511. "hostname": "",
  1512. "port": "",
  1513. "pathname": "/",
  1514. "search": "",
  1515. "hash": ""
  1516. },
  1517. {
  1518. "input": "file://localhost/test",
  1519. "base": "file:///tmp/mock/path",
  1520. "href": "file:///test",
  1521. "protocol": "file:",
  1522. "username": "",
  1523. "password": "",
  1524. "host": "",
  1525. "hostname": "",
  1526. "port": "",
  1527. "pathname": "/test",
  1528. "search": "",
  1529. "hash": ""
  1530. },
  1531. {
  1532. "input": "test",
  1533. "base": "file:///tmp/mock/path",
  1534. "href": "file:///tmp/mock/test",
  1535. "protocol": "file:",
  1536. "username": "",
  1537. "password": "",
  1538. "host": "",
  1539. "hostname": "",
  1540. "port": "",
  1541. "pathname": "/tmp/mock/test",
  1542. "search": "",
  1543. "hash": ""
  1544. },
  1545. {
  1546. "input": "file:test",
  1547. "base": "file:///tmp/mock/path",
  1548. "href": "file:///tmp/mock/test",
  1549. "protocol": "file:",
  1550. "username": "",
  1551. "password": "",
  1552. "host": "",
  1553. "hostname": "",
  1554. "port": "",
  1555. "pathname": "/tmp/mock/test",
  1556. "search": "",
  1557. "hash": ""
  1558. },
  1559. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
  1560. {
  1561. "input": "http://example.com/././foo",
  1562. "base": "about:blank",
  1563. "href": "http://example.com/foo",
  1564. "origin": "http://example.com",
  1565. "protocol": "http:",
  1566. "username": "",
  1567. "password": "",
  1568. "host": "example.com",
  1569. "hostname": "example.com",
  1570. "port": "",
  1571. "pathname": "/foo",
  1572. "search": "",
  1573. "hash": ""
  1574. },
  1575. {
  1576. "input": "http://example.com/./.foo",
  1577. "base": "about:blank",
  1578. "href": "http://example.com/.foo",
  1579. "origin": "http://example.com",
  1580. "protocol": "http:",
  1581. "username": "",
  1582. "password": "",
  1583. "host": "example.com",
  1584. "hostname": "example.com",
  1585. "port": "",
  1586. "pathname": "/.foo",
  1587. "search": "",
  1588. "hash": ""
  1589. },
  1590. {
  1591. "input": "http://example.com/foo/.",
  1592. "base": "about:blank",
  1593. "href": "http://example.com/foo/",
  1594. "origin": "http://example.com",
  1595. "protocol": "http:",
  1596. "username": "",
  1597. "password": "",
  1598. "host": "example.com",
  1599. "hostname": "example.com",
  1600. "port": "",
  1601. "pathname": "/foo/",
  1602. "search": "",
  1603. "hash": ""
  1604. },
  1605. {
  1606. "input": "http://example.com/foo/./",
  1607. "base": "about:blank",
  1608. "href": "http://example.com/foo/",
  1609. "origin": "http://example.com",
  1610. "protocol": "http:",
  1611. "username": "",
  1612. "password": "",
  1613. "host": "example.com",
  1614. "hostname": "example.com",
  1615. "port": "",
  1616. "pathname": "/foo/",
  1617. "search": "",
  1618. "hash": ""
  1619. },
  1620. {
  1621. "input": "http://example.com/foo/bar/..",
  1622. "base": "about:blank",
  1623. "href": "http://example.com/foo/",
  1624. "origin": "http://example.com",
  1625. "protocol": "http:",
  1626. "username": "",
  1627. "password": "",
  1628. "host": "example.com",
  1629. "hostname": "example.com",
  1630. "port": "",
  1631. "pathname": "/foo/",
  1632. "search": "",
  1633. "hash": ""
  1634. },
  1635. {
  1636. "input": "http://example.com/foo/bar/../",
  1637. "base": "about:blank",
  1638. "href": "http://example.com/foo/",
  1639. "origin": "http://example.com",
  1640. "protocol": "http:",
  1641. "username": "",
  1642. "password": "",
  1643. "host": "example.com",
  1644. "hostname": "example.com",
  1645. "port": "",
  1646. "pathname": "/foo/",
  1647. "search": "",
  1648. "hash": ""
  1649. },
  1650. {
  1651. "input": "http://example.com/foo/..bar",
  1652. "base": "about:blank",
  1653. "href": "http://example.com/foo/..bar",
  1654. "origin": "http://example.com",
  1655. "protocol": "http:",
  1656. "username": "",
  1657. "password": "",
  1658. "host": "example.com",
  1659. "hostname": "example.com",
  1660. "port": "",
  1661. "pathname": "/foo/..bar",
  1662. "search": "",
  1663. "hash": ""
  1664. },
  1665. {
  1666. "input": "http://example.com/foo/bar/../ton",
  1667. "base": "about:blank",
  1668. "href": "http://example.com/foo/ton",
  1669. "origin": "http://example.com",
  1670. "protocol": "http:",
  1671. "username": "",
  1672. "password": "",
  1673. "host": "example.com",
  1674. "hostname": "example.com",
  1675. "port": "",
  1676. "pathname": "/foo/ton",
  1677. "search": "",
  1678. "hash": ""
  1679. },
  1680. {
  1681. "input": "http://example.com/foo/bar/../ton/../../a",
  1682. "base": "about:blank",
  1683. "href": "http://example.com/a",
  1684. "origin": "http://example.com",
  1685. "protocol": "http:",
  1686. "username": "",
  1687. "password": "",
  1688. "host": "example.com",
  1689. "hostname": "example.com",
  1690. "port": "",
  1691. "pathname": "/a",
  1692. "search": "",
  1693. "hash": ""
  1694. },
  1695. {
  1696. "input": "http://example.com/foo/../../..",
  1697. "base": "about:blank",
  1698. "href": "http://example.com/",
  1699. "origin": "http://example.com",
  1700. "protocol": "http:",
  1701. "username": "",
  1702. "password": "",
  1703. "host": "example.com",
  1704. "hostname": "example.com",
  1705. "port": "",
  1706. "pathname": "/",
  1707. "search": "",
  1708. "hash": ""
  1709. },
  1710. {
  1711. "input": "http://example.com/foo/../../../ton",
  1712. "base": "about:blank",
  1713. "href": "http://example.com/ton",
  1714. "origin": "http://example.com",
  1715. "protocol": "http:",
  1716. "username": "",
  1717. "password": "",
  1718. "host": "example.com",
  1719. "hostname": "example.com",
  1720. "port": "",
  1721. "pathname": "/ton",
  1722. "search": "",
  1723. "hash": ""
  1724. },
  1725. {
  1726. "input": "http://example.com/foo/%2e",
  1727. "base": "about:blank",
  1728. "href": "http://example.com/foo/",
  1729. "origin": "http://example.com",
  1730. "protocol": "http:",
  1731. "username": "",
  1732. "password": "",
  1733. "host": "example.com",
  1734. "hostname": "example.com",
  1735. "port": "",
  1736. "pathname": "/foo/",
  1737. "search": "",
  1738. "hash": ""
  1739. },
  1740. {
  1741. "input": "http://example.com/foo/%2e%2",
  1742. "base": "about:blank",
  1743. "href": "http://example.com/foo/.%2",
  1744. "origin": "http://example.com",
  1745. "protocol": "http:",
  1746. "username": "",
  1747. "password": "",
  1748. "host": "example.com",
  1749. "hostname": "example.com",
  1750. "port": "",
  1751. "pathname": "/foo/.%2",
  1752. "search": "",
  1753. "hash": ""
  1754. },
  1755. {
  1756. "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
  1757. "base": "about:blank",
  1758. "href": "http://example.com/..bar",
  1759. "origin": "http://example.com",
  1760. "protocol": "http:",
  1761. "username": "",
  1762. "password": "",
  1763. "host": "example.com",
  1764. "hostname": "example.com",
  1765. "port": "",
  1766. "pathname": "/..bar",
  1767. "search": "",
  1768. "hash": ""
  1769. },
  1770. {
  1771. "input": "http://example.com////../..",
  1772. "base": "about:blank",
  1773. "href": "http://example.com//",
  1774. "origin": "http://example.com",
  1775. "protocol": "http:",
  1776. "username": "",
  1777. "password": "",
  1778. "host": "example.com",
  1779. "hostname": "example.com",
  1780. "port": "",
  1781. "pathname": "//",
  1782. "search": "",
  1783. "hash": ""
  1784. },
  1785. {
  1786. "input": "http://example.com/foo/bar//../..",
  1787. "base": "about:blank",
  1788. "href": "http://example.com/foo/",
  1789. "origin": "http://example.com",
  1790. "protocol": "http:",
  1791. "username": "",
  1792. "password": "",
  1793. "host": "example.com",
  1794. "hostname": "example.com",
  1795. "port": "",
  1796. "pathname": "/foo/",
  1797. "search": "",
  1798. "hash": ""
  1799. },
  1800. {
  1801. "input": "http://example.com/foo/bar//..",
  1802. "base": "about:blank",
  1803. "href": "http://example.com/foo/bar/",
  1804. "origin": "http://example.com",
  1805. "protocol": "http:",
  1806. "username": "",
  1807. "password": "",
  1808. "host": "example.com",
  1809. "hostname": "example.com",
  1810. "port": "",
  1811. "pathname": "/foo/bar/",
  1812. "search": "",
  1813. "hash": ""
  1814. },
  1815. {
  1816. "input": "http://example.com/foo",
  1817. "base": "about:blank",
  1818. "href": "http://example.com/foo",
  1819. "origin": "http://example.com",
  1820. "protocol": "http:",
  1821. "username": "",
  1822. "password": "",
  1823. "host": "example.com",
  1824. "hostname": "example.com",
  1825. "port": "",
  1826. "pathname": "/foo",
  1827. "search": "",
  1828. "hash": ""
  1829. },
  1830. {
  1831. "input": "http://example.com/%20foo",
  1832. "base": "about:blank",
  1833. "href": "http://example.com/%20foo",
  1834. "origin": "http://example.com",
  1835. "protocol": "http:",
  1836. "username": "",
  1837. "password": "",
  1838. "host": "example.com",
  1839. "hostname": "example.com",
  1840. "port": "",
  1841. "pathname": "/%20foo",
  1842. "search": "",
  1843. "hash": ""
  1844. },
  1845. {
  1846. "input": "http://example.com/foo%",
  1847. "base": "about:blank",
  1848. "href": "http://example.com/foo%",
  1849. "origin": "http://example.com",
  1850. "protocol": "http:",
  1851. "username": "",
  1852. "password": "",
  1853. "host": "example.com",
  1854. "hostname": "example.com",
  1855. "port": "",
  1856. "pathname": "/foo%",
  1857. "search": "",
  1858. "hash": ""
  1859. },
  1860. {
  1861. "input": "http://example.com/foo%2",
  1862. "base": "about:blank",
  1863. "href": "http://example.com/foo%2",
  1864. "origin": "http://example.com",
  1865. "protocol": "http:",
  1866. "username": "",
  1867. "password": "",
  1868. "host": "example.com",
  1869. "hostname": "example.com",
  1870. "port": "",
  1871. "pathname": "/foo%2",
  1872. "search": "",
  1873. "hash": ""
  1874. },
  1875. {
  1876. "input": "http://example.com/foo%2zbar",
  1877. "base": "about:blank",
  1878. "href": "http://example.com/foo%2zbar",
  1879. "origin": "http://example.com",
  1880. "protocol": "http:",
  1881. "username": "",
  1882. "password": "",
  1883. "host": "example.com",
  1884. "hostname": "example.com",
  1885. "port": "",
  1886. "pathname": "/foo%2zbar",
  1887. "search": "",
  1888. "hash": ""
  1889. },
  1890. {
  1891. "input": "http://example.com/foo%2©zbar",
  1892. "base": "about:blank",
  1893. "href": "http://example.com/foo%2%C3%82%C2%A9zbar",
  1894. "origin": "http://example.com",
  1895. "protocol": "http:",
  1896. "username": "",
  1897. "password": "",
  1898. "host": "example.com",
  1899. "hostname": "example.com",
  1900. "port": "",
  1901. "pathname": "/foo%2%C3%82%C2%A9zbar",
  1902. "search": "",
  1903. "hash": ""
  1904. },
  1905. {
  1906. "input": "http://example.com/foo%41%7a",
  1907. "base": "about:blank",
  1908. "href": "http://example.com/foo%41%7a",
  1909. "origin": "http://example.com",
  1910. "protocol": "http:",
  1911. "username": "",
  1912. "password": "",
  1913. "host": "example.com",
  1914. "hostname": "example.com",
  1915. "port": "",
  1916. "pathname": "/foo%41%7a",
  1917. "search": "",
  1918. "hash": ""
  1919. },
  1920. {
  1921. "input": "http://example.com/foo\t\u0091%91",
  1922. "base": "about:blank",
  1923. "href": "http://example.com/foo%C2%91%91",
  1924. "origin": "http://example.com",
  1925. "protocol": "http:",
  1926. "username": "",
  1927. "password": "",
  1928. "host": "example.com",
  1929. "hostname": "example.com",
  1930. "port": "",
  1931. "pathname": "/foo%C2%91%91",
  1932. "search": "",
  1933. "hash": ""
  1934. },
  1935. {
  1936. "input": "http://example.com/foo%00%51",
  1937. "base": "about:blank",
  1938. "href": "http://example.com/foo%00%51",
  1939. "origin": "http://example.com",
  1940. "protocol": "http:",
  1941. "username": "",
  1942. "password": "",
  1943. "host": "example.com",
  1944. "hostname": "example.com",
  1945. "port": "",
  1946. "pathname": "/foo%00%51",
  1947. "search": "",
  1948. "hash": ""
  1949. },
  1950. {
  1951. "input": "http://example.com/(%28:%3A%29)",
  1952. "base": "about:blank",
  1953. "href": "http://example.com/(%28:%3A%29)",
  1954. "origin": "http://example.com",
  1955. "protocol": "http:",
  1956. "username": "",
  1957. "password": "",
  1958. "host": "example.com",
  1959. "hostname": "example.com",
  1960. "port": "",
  1961. "pathname": "/(%28:%3A%29)",
  1962. "search": "",
  1963. "hash": ""
  1964. },
  1965. {
  1966. "input": "http://example.com/%3A%3a%3C%3c",
  1967. "base": "about:blank",
  1968. "href": "http://example.com/%3A%3a%3C%3c",
  1969. "origin": "http://example.com",
  1970. "protocol": "http:",
  1971. "username": "",
  1972. "password": "",
  1973. "host": "example.com",
  1974. "hostname": "example.com",
  1975. "port": "",
  1976. "pathname": "/%3A%3a%3C%3c",
  1977. "search": "",
  1978. "hash": ""
  1979. },
  1980. {
  1981. "input": "http://example.com/foo\tbar",
  1982. "base": "about:blank",
  1983. "href": "http://example.com/foobar",
  1984. "origin": "http://example.com",
  1985. "protocol": "http:",
  1986. "username": "",
  1987. "password": "",
  1988. "host": "example.com",
  1989. "hostname": "example.com",
  1990. "port": "",
  1991. "pathname": "/foobar",
  1992. "search": "",
  1993. "hash": ""
  1994. },
  1995. {
  1996. "input": "http://example.com\\\\foo\\\\bar",
  1997. "base": "about:blank",
  1998. "href": "http://example.com//foo//bar",
  1999. "origin": "http://example.com",
  2000. "protocol": "http:",
  2001. "username": "",
  2002. "password": "",
  2003. "host": "example.com",
  2004. "hostname": "example.com",
  2005. "port": "",
  2006. "pathname": "//foo//bar",
  2007. "search": "",
  2008. "hash": ""
  2009. },
  2010. {
  2011. "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2012. "base": "about:blank",
  2013. "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2014. "origin": "http://example.com",
  2015. "protocol": "http:",
  2016. "username": "",
  2017. "password": "",
  2018. "host": "example.com",
  2019. "hostname": "example.com",
  2020. "port": "",
  2021. "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2022. "search": "",
  2023. "hash": ""
  2024. },
  2025. {
  2026. "input": "http://example.com/@asdf%40",
  2027. "base": "about:blank",
  2028. "href": "http://example.com/@asdf%40",
  2029. "origin": "http://example.com",
  2030. "protocol": "http:",
  2031. "username": "",
  2032. "password": "",
  2033. "host": "example.com",
  2034. "hostname": "example.com",
  2035. "port": "",
  2036. "pathname": "/@asdf%40",
  2037. "search": "",
  2038. "hash": ""
  2039. },
  2040. {
  2041. "input": "http://example.com/你好你好",
  2042. "base": "about:blank",
  2043. "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2044. "origin": "http://example.com",
  2045. "protocol": "http:",
  2046. "username": "",
  2047. "password": "",
  2048. "host": "example.com",
  2049. "hostname": "example.com",
  2050. "port": "",
  2051. "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2052. "search": "",
  2053. "hash": ""
  2054. },
  2055. {
  2056. "input": "http://example.com/‥/foo",
  2057. "base": "about:blank",
  2058. "href": "http://example.com/%E2%80%A5/foo",
  2059. "origin": "http://example.com",
  2060. "protocol": "http:",
  2061. "username": "",
  2062. "password": "",
  2063. "host": "example.com",
  2064. "hostname": "example.com",
  2065. "port": "",
  2066. "pathname": "/%E2%80%A5/foo",
  2067. "search": "",
  2068. "hash": ""
  2069. },
  2070. {
  2071. "input": "http://example.com//foo",
  2072. "base": "about:blank",
  2073. "href": "http://example.com/%EF%BB%BF/foo",
  2074. "origin": "http://example.com",
  2075. "protocol": "http:",
  2076. "username": "",
  2077. "password": "",
  2078. "host": "example.com",
  2079. "hostname": "example.com",
  2080. "port": "",
  2081. "pathname": "/%EF%BB%BF/foo",
  2082. "search": "",
  2083. "hash": ""
  2084. },
  2085. {
  2086. "input": "http://example.com/‮/foo/‭/bar",
  2087. "base": "about:blank",
  2088. "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar",
  2089. "origin": "http://example.com",
  2090. "protocol": "http:",
  2091. "username": "",
  2092. "password": "",
  2093. "host": "example.com",
  2094. "hostname": "example.com",
  2095. "port": "",
  2096. "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
  2097. "search": "",
  2098. "hash": ""
  2099. },
  2100. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js",
  2101. {
  2102. "input": "http://www.google.com/foo?bar=baz#",
  2103. "base": "about:blank",
  2104. "href": "http://www.google.com/foo?bar=baz#",
  2105. "origin": "http://www.google.com",
  2106. "protocol": "http:",
  2107. "username": "",
  2108. "password": "",
  2109. "host": "www.google.com",
  2110. "hostname": "www.google.com",
  2111. "port": "",
  2112. "pathname": "/foo",
  2113. "search": "?bar=baz",
  2114. "hash": ""
  2115. },
  2116. {
  2117. "input": "http://www.google.com/foo?bar=baz# »",
  2118. "base": "about:blank",
  2119. "href": "http://www.google.com/foo?bar=baz# »",
  2120. "origin": "http://www.google.com",
  2121. "protocol": "http:",
  2122. "username": "",
  2123. "password": "",
  2124. "host": "www.google.com",
  2125. "hostname": "www.google.com",
  2126. "port": "",
  2127. "pathname": "/foo",
  2128. "search": "?bar=baz",
  2129. "hash": "# »"
  2130. },
  2131. {
  2132. "input": "data:test# »",
  2133. "base": "about:blank",
  2134. "href": "data:test# »",
  2135. "origin": "null",
  2136. "protocol": "data:",
  2137. "username": "",
  2138. "password": "",
  2139. "host": "",
  2140. "hostname": "",
  2141. "port": "",
  2142. "pathname": "test",
  2143. "search": "",
  2144. "hash": "# »"
  2145. },
  2146. {
  2147. "input": "http://[www.google.com]/",
  2148. "base": "about:blank",
  2149. "failure": true
  2150. },
  2151. {
  2152. "input": "http://www.google.com",
  2153. "base": "about:blank",
  2154. "href": "http://www.google.com/",
  2155. "origin": "http://www.google.com",
  2156. "protocol": "http:",
  2157. "username": "",
  2158. "password": "",
  2159. "host": "www.google.com",
  2160. "hostname": "www.google.com",
  2161. "port": "",
  2162. "pathname": "/",
  2163. "search": "",
  2164. "hash": ""
  2165. },
  2166. {
  2167. "input": "http://192.0x00A80001",
  2168. "base": "about:blank",
  2169. "href": "http://192.168.0.1/",
  2170. "origin": "http://192.168.0.1",
  2171. "protocol": "http:",
  2172. "username": "",
  2173. "password": "",
  2174. "host": "192.168.0.1",
  2175. "hostname": "192.168.0.1",
  2176. "port": "",
  2177. "pathname": "/",
  2178. "search": "",
  2179. "hash": ""
  2180. },
  2181. {
  2182. "input": "http://www/foo%2Ehtml",
  2183. "base": "about:blank",
  2184. "href": "http://www/foo.html",
  2185. "origin": "http://www",
  2186. "protocol": "http:",
  2187. "username": "",
  2188. "password": "",
  2189. "host": "www",
  2190. "hostname": "www",
  2191. "port": "",
  2192. "pathname": "/foo.html",
  2193. "search": "",
  2194. "hash": ""
  2195. },
  2196. {
  2197. "input": "http://www/foo/%2E/html",
  2198. "base": "about:blank",
  2199. "href": "http://www/foo/html",
  2200. "origin": "http://www",
  2201. "protocol": "http:",
  2202. "username": "",
  2203. "password": "",
  2204. "host": "www",
  2205. "hostname": "www",
  2206. "port": "",
  2207. "pathname": "/foo/html",
  2208. "search": "",
  2209. "hash": ""
  2210. },
  2211. {
  2212. "input": "http://user:pass@/",
  2213. "base": "about:blank",
  2214. "failure": true
  2215. },
  2216. {
  2217. "input": "http://%25DOMAIN:foobar@foodomain.com/",
  2218. "base": "about:blank",
  2219. "href": "http://%25DOMAIN:foobar@foodomain.com/",
  2220. "origin": "http://foodomain.com",
  2221. "protocol": "http:",
  2222. "username": "%25DOMAIN",
  2223. "password": "foobar",
  2224. "host": "foodomain.com",
  2225. "hostname": "foodomain.com",
  2226. "port": "",
  2227. "pathname": "/",
  2228. "search": "",
  2229. "hash": ""
  2230. },
  2231. {
  2232. "input": "http:\\\\www.google.com\\foo",
  2233. "base": "about:blank",
  2234. "href": "http://www.google.com/foo",
  2235. "origin": "http://www.google.com",
  2236. "protocol": "http:",
  2237. "username": "",
  2238. "password": "",
  2239. "host": "www.google.com",
  2240. "hostname": "www.google.com",
  2241. "port": "",
  2242. "pathname": "/foo",
  2243. "search": "",
  2244. "hash": ""
  2245. },
  2246. {
  2247. "input": "http://foo:80/",
  2248. "base": "about:blank",
  2249. "href": "http://foo/",
  2250. "origin": "http://foo",
  2251. "protocol": "http:",
  2252. "username": "",
  2253. "password": "",
  2254. "host": "foo",
  2255. "hostname": "foo",
  2256. "port": "",
  2257. "pathname": "/",
  2258. "search": "",
  2259. "hash": ""
  2260. },
  2261. {
  2262. "input": "http://foo:81/",
  2263. "base": "about:blank",
  2264. "href": "http://foo:81/",
  2265. "origin": "http://foo:81",
  2266. "protocol": "http:",
  2267. "username": "",
  2268. "password": "",
  2269. "host": "foo:81",
  2270. "hostname": "foo",
  2271. "port": "81",
  2272. "pathname": "/",
  2273. "search": "",
  2274. "hash": ""
  2275. },
  2276. {
  2277. "input": "httpa://foo:80/",
  2278. "base": "about:blank",
  2279. "href": "httpa://foo:80/",
  2280. "origin": "null",
  2281. "protocol": "httpa:",
  2282. "username": "",
  2283. "password": "",
  2284. "host": "foo:80",
  2285. "hostname": "foo",
  2286. "port": "80",
  2287. "pathname": "/",
  2288. "search": "",
  2289. "hash": ""
  2290. },
  2291. {
  2292. "input": "http://foo:-80/",
  2293. "base": "about:blank",
  2294. "failure": true
  2295. },
  2296. {
  2297. "input": "https://foo:443/",
  2298. "base": "about:blank",
  2299. "href": "https://foo/",
  2300. "origin": "https://foo",
  2301. "protocol": "https:",
  2302. "username": "",
  2303. "password": "",
  2304. "host": "foo",
  2305. "hostname": "foo",
  2306. "port": "",
  2307. "pathname": "/",
  2308. "search": "",
  2309. "hash": ""
  2310. },
  2311. {
  2312. "input": "https://foo:80/",
  2313. "base": "about:blank",
  2314. "href": "https://foo:80/",
  2315. "origin": "https://foo:80",
  2316. "protocol": "https:",
  2317. "username": "",
  2318. "password": "",
  2319. "host": "foo:80",
  2320. "hostname": "foo",
  2321. "port": "80",
  2322. "pathname": "/",
  2323. "search": "",
  2324. "hash": ""
  2325. },
  2326. {
  2327. "input": "ftp://foo:21/",
  2328. "base": "about:blank",
  2329. "href": "ftp://foo/",
  2330. "origin": "ftp://foo",
  2331. "protocol": "ftp:",
  2332. "username": "",
  2333. "password": "",
  2334. "host": "foo",
  2335. "hostname": "foo",
  2336. "port": "",
  2337. "pathname": "/",
  2338. "search": "",
  2339. "hash": ""
  2340. },
  2341. {
  2342. "input": "ftp://foo:80/",
  2343. "base": "about:blank",
  2344. "href": "ftp://foo:80/",
  2345. "origin": "ftp://foo:80",
  2346. "protocol": "ftp:",
  2347. "username": "",
  2348. "password": "",
  2349. "host": "foo:80",
  2350. "hostname": "foo",
  2351. "port": "80",
  2352. "pathname": "/",
  2353. "search": "",
  2354. "hash": ""
  2355. },
  2356. {
  2357. "input": "gopher://foo:70/",
  2358. "base": "about:blank",
  2359. "href": "gopher://foo/",
  2360. "origin": "gopher://foo",
  2361. "protocol": "gopher:",
  2362. "username": "",
  2363. "password": "",
  2364. "host": "foo",
  2365. "hostname": "foo",
  2366. "port": "",
  2367. "pathname": "/",
  2368. "search": "",
  2369. "hash": ""
  2370. },
  2371. {
  2372. "input": "gopher://foo:443/",
  2373. "base": "about:blank",
  2374. "href": "gopher://foo:443/",
  2375. "origin": "gopher://foo:443",
  2376. "protocol": "gopher:",
  2377. "username": "",
  2378. "password": "",
  2379. "host": "foo:443",
  2380. "hostname": "foo",
  2381. "port": "443",
  2382. "pathname": "/",
  2383. "search": "",
  2384. "hash": ""
  2385. },
  2386. {
  2387. "input": "ws://foo:80/",
  2388. "base": "about:blank",
  2389. "href": "ws://foo/",
  2390. "origin": "ws://foo",
  2391. "protocol": "ws:",
  2392. "username": "",
  2393. "password": "",
  2394. "host": "foo",
  2395. "hostname": "foo",
  2396. "port": "",
  2397. "pathname": "/",
  2398. "search": "",
  2399. "hash": ""
  2400. },
  2401. {
  2402. "input": "ws://foo:81/",
  2403. "base": "about:blank",
  2404. "href": "ws://foo:81/",
  2405. "origin": "ws://foo:81",
  2406. "protocol": "ws:",
  2407. "username": "",
  2408. "password": "",
  2409. "host": "foo:81",
  2410. "hostname": "foo",
  2411. "port": "81",
  2412. "pathname": "/",
  2413. "search": "",
  2414. "hash": ""
  2415. },
  2416. {
  2417. "input": "ws://foo:443/",
  2418. "base": "about:blank",
  2419. "href": "ws://foo:443/",
  2420. "origin": "ws://foo:443",
  2421. "protocol": "ws:",
  2422. "username": "",
  2423. "password": "",
  2424. "host": "foo:443",
  2425. "hostname": "foo",
  2426. "port": "443",
  2427. "pathname": "/",
  2428. "search": "",
  2429. "hash": ""
  2430. },
  2431. {
  2432. "input": "ws://foo:815/",
  2433. "base": "about:blank",
  2434. "href": "ws://foo:815/",
  2435. "origin": "ws://foo:815",
  2436. "protocol": "ws:",
  2437. "username": "",
  2438. "password": "",
  2439. "host": "foo:815",
  2440. "hostname": "foo",
  2441. "port": "815",
  2442. "pathname": "/",
  2443. "search": "",
  2444. "hash": ""
  2445. },
  2446. {
  2447. "input": "wss://foo:80/",
  2448. "base": "about:blank",
  2449. "href": "wss://foo:80/",
  2450. "origin": "wss://foo:80",
  2451. "protocol": "wss:",
  2452. "username": "",
  2453. "password": "",
  2454. "host": "foo:80",
  2455. "hostname": "foo",
  2456. "port": "80",
  2457. "pathname": "/",
  2458. "search": "",
  2459. "hash": ""
  2460. },
  2461. {
  2462. "input": "wss://foo:81/",
  2463. "base": "about:blank",
  2464. "href": "wss://foo:81/",
  2465. "origin": "wss://foo:81",
  2466. "protocol": "wss:",
  2467. "username": "",
  2468. "password": "",
  2469. "host": "foo:81",
  2470. "hostname": "foo",
  2471. "port": "81",
  2472. "pathname": "/",
  2473. "search": "",
  2474. "hash": ""
  2475. },
  2476. {
  2477. "input": "wss://foo:443/",
  2478. "base": "about:blank",
  2479. "href": "wss://foo/",
  2480. "origin": "wss://foo",
  2481. "protocol": "wss:",
  2482. "username": "",
  2483. "password": "",
  2484. "host": "foo",
  2485. "hostname": "foo",
  2486. "port": "",
  2487. "pathname": "/",
  2488. "search": "",
  2489. "hash": ""
  2490. },
  2491. {
  2492. "input": "wss://foo:815/",
  2493. "base": "about:blank",
  2494. "href": "wss://foo:815/",
  2495. "origin": "wss://foo:815",
  2496. "protocol": "wss:",
  2497. "username": "",
  2498. "password": "",
  2499. "host": "foo:815",
  2500. "hostname": "foo",
  2501. "port": "815",
  2502. "pathname": "/",
  2503. "search": "",
  2504. "hash": ""
  2505. },
  2506. {
  2507. "input": "http:/example.com/",
  2508. "base": "about:blank",
  2509. "href": "http://example.com/",
  2510. "origin": "http://example.com",
  2511. "protocol": "http:",
  2512. "username": "",
  2513. "password": "",
  2514. "host": "example.com",
  2515. "hostname": "example.com",
  2516. "port": "",
  2517. "pathname": "/",
  2518. "search": "",
  2519. "hash": ""
  2520. },
  2521. {
  2522. "input": "ftp:/example.com/",
  2523. "base": "about:blank",
  2524. "href": "ftp://example.com/",
  2525. "origin": "ftp://example.com",
  2526. "protocol": "ftp:",
  2527. "username": "",
  2528. "password": "",
  2529. "host": "example.com",
  2530. "hostname": "example.com",
  2531. "port": "",
  2532. "pathname": "/",
  2533. "search": "",
  2534. "hash": ""
  2535. },
  2536. {
  2537. "input": "https:/example.com/",
  2538. "base": "about:blank",
  2539. "href": "https://example.com/",
  2540. "origin": "https://example.com",
  2541. "protocol": "https:",
  2542. "username": "",
  2543. "password": "",
  2544. "host": "example.com",
  2545. "hostname": "example.com",
  2546. "port": "",
  2547. "pathname": "/",
  2548. "search": "",
  2549. "hash": ""
  2550. },
  2551. {
  2552. "input": "madeupscheme:/example.com/",
  2553. "base": "about:blank",
  2554. "href": "madeupscheme:/example.com/",
  2555. "origin": "null",
  2556. "protocol": "madeupscheme:",
  2557. "username": "",
  2558. "password": "",
  2559. "host": "",
  2560. "hostname": "",
  2561. "port": "",
  2562. "pathname": "/example.com/",
  2563. "search": "",
  2564. "hash": ""
  2565. },
  2566. {
  2567. "input": "file:/example.com/",
  2568. "base": "about:blank",
  2569. "href": "file:///example.com/",
  2570. "protocol": "file:",
  2571. "username": "",
  2572. "password": "",
  2573. "host": "",
  2574. "hostname": "",
  2575. "port": "",
  2576. "pathname": "/example.com/",
  2577. "search": "",
  2578. "hash": ""
  2579. },
  2580. {
  2581. "input": "ftps:/example.com/",
  2582. "base": "about:blank",
  2583. "href": "ftps:/example.com/",
  2584. "origin": "null",
  2585. "protocol": "ftps:",
  2586. "username": "",
  2587. "password": "",
  2588. "host": "",
  2589. "hostname": "",
  2590. "port": "",
  2591. "pathname": "/example.com/",
  2592. "search": "",
  2593. "hash": ""
  2594. },
  2595. {
  2596. "input": "gopher:/example.com/",
  2597. "base": "about:blank",
  2598. "href": "gopher://example.com/",
  2599. "origin": "gopher://example.com",
  2600. "protocol": "gopher:",
  2601. "username": "",
  2602. "password": "",
  2603. "host": "example.com",
  2604. "hostname": "example.com",
  2605. "port": "",
  2606. "pathname": "/",
  2607. "search": "",
  2608. "hash": ""
  2609. },
  2610. {
  2611. "input": "ws:/example.com/",
  2612. "base": "about:blank",
  2613. "href": "ws://example.com/",
  2614. "origin": "ws://example.com",
  2615. "protocol": "ws:",
  2616. "username": "",
  2617. "password": "",
  2618. "host": "example.com",
  2619. "hostname": "example.com",
  2620. "port": "",
  2621. "pathname": "/",
  2622. "search": "",
  2623. "hash": ""
  2624. },
  2625. {
  2626. "input": "wss:/example.com/",
  2627. "base": "about:blank",
  2628. "href": "wss://example.com/",
  2629. "origin": "wss://example.com",
  2630. "protocol": "wss:",
  2631. "username": "",
  2632. "password": "",
  2633. "host": "example.com",
  2634. "hostname": "example.com",
  2635. "port": "",
  2636. "pathname": "/",
  2637. "search": "",
  2638. "hash": ""
  2639. },
  2640. {
  2641. "input": "data:/example.com/",
  2642. "base": "about:blank",
  2643. "href": "data:/example.com/",
  2644. "origin": "null",
  2645. "protocol": "data:",
  2646. "username": "",
  2647. "password": "",
  2648. "host": "",
  2649. "hostname": "",
  2650. "port": "",
  2651. "pathname": "/example.com/",
  2652. "search": "",
  2653. "hash": ""
  2654. },
  2655. {
  2656. "input": "javascript:/example.com/",
  2657. "base": "about:blank",
  2658. "href": "javascript:/example.com/",
  2659. "origin": "null",
  2660. "protocol": "javascript:",
  2661. "username": "",
  2662. "password": "",
  2663. "host": "",
  2664. "hostname": "",
  2665. "port": "",
  2666. "pathname": "/example.com/",
  2667. "search": "",
  2668. "hash": ""
  2669. },
  2670. {
  2671. "input": "mailto:/example.com/",
  2672. "base": "about:blank",
  2673. "href": "mailto:/example.com/",
  2674. "origin": "null",
  2675. "protocol": "mailto:",
  2676. "username": "",
  2677. "password": "",
  2678. "host": "",
  2679. "hostname": "",
  2680. "port": "",
  2681. "pathname": "/example.com/",
  2682. "search": "",
  2683. "hash": ""
  2684. },
  2685. {
  2686. "input": "http:example.com/",
  2687. "base": "about:blank",
  2688. "href": "http://example.com/",
  2689. "origin": "http://example.com",
  2690. "protocol": "http:",
  2691. "username": "",
  2692. "password": "",
  2693. "host": "example.com",
  2694. "hostname": "example.com",
  2695. "port": "",
  2696. "pathname": "/",
  2697. "search": "",
  2698. "hash": ""
  2699. },
  2700. {
  2701. "input": "ftp:example.com/",
  2702. "base": "about:blank",
  2703. "href": "ftp://example.com/",
  2704. "origin": "ftp://example.com",
  2705. "protocol": "ftp:",
  2706. "username": "",
  2707. "password": "",
  2708. "host": "example.com",
  2709. "hostname": "example.com",
  2710. "port": "",
  2711. "pathname": "/",
  2712. "search": "",
  2713. "hash": ""
  2714. },
  2715. {
  2716. "input": "https:example.com/",
  2717. "base": "about:blank",
  2718. "href": "https://example.com/",
  2719. "origin": "https://example.com",
  2720. "protocol": "https:",
  2721. "username": "",
  2722. "password": "",
  2723. "host": "example.com",
  2724. "hostname": "example.com",
  2725. "port": "",
  2726. "pathname": "/",
  2727. "search": "",
  2728. "hash": ""
  2729. },
  2730. {
  2731. "input": "madeupscheme:example.com/",
  2732. "base": "about:blank",
  2733. "href": "madeupscheme:example.com/",
  2734. "origin": "null",
  2735. "protocol": "madeupscheme:",
  2736. "username": "",
  2737. "password": "",
  2738. "host": "",
  2739. "hostname": "",
  2740. "port": "",
  2741. "pathname": "example.com/",
  2742. "search": "",
  2743. "hash": ""
  2744. },
  2745. {
  2746. "input": "ftps:example.com/",
  2747. "base": "about:blank",
  2748. "href": "ftps:example.com/",
  2749. "origin": "null",
  2750. "protocol": "ftps:",
  2751. "username": "",
  2752. "password": "",
  2753. "host": "",
  2754. "hostname": "",
  2755. "port": "",
  2756. "pathname": "example.com/",
  2757. "search": "",
  2758. "hash": ""
  2759. },
  2760. {
  2761. "input": "gopher:example.com/",
  2762. "base": "about:blank",
  2763. "href": "gopher://example.com/",
  2764. "origin": "gopher://example.com",
  2765. "protocol": "gopher:",
  2766. "username": "",
  2767. "password": "",
  2768. "host": "example.com",
  2769. "hostname": "example.com",
  2770. "port": "",
  2771. "pathname": "/",
  2772. "search": "",
  2773. "hash": ""
  2774. },
  2775. {
  2776. "input": "ws:example.com/",
  2777. "base": "about:blank",
  2778. "href": "ws://example.com/",
  2779. "origin": "ws://example.com",
  2780. "protocol": "ws:",
  2781. "username": "",
  2782. "password": "",
  2783. "host": "example.com",
  2784. "hostname": "example.com",
  2785. "port": "",
  2786. "pathname": "/",
  2787. "search": "",
  2788. "hash": ""
  2789. },
  2790. {
  2791. "input": "wss:example.com/",
  2792. "base": "about:blank",
  2793. "href": "wss://example.com/",
  2794. "origin": "wss://example.com",
  2795. "protocol": "wss:",
  2796. "username": "",
  2797. "password": "",
  2798. "host": "example.com",
  2799. "hostname": "example.com",
  2800. "port": "",
  2801. "pathname": "/",
  2802. "search": "",
  2803. "hash": ""
  2804. },
  2805. {
  2806. "input": "data:example.com/",
  2807. "base": "about:blank",
  2808. "href": "data:example.com/",
  2809. "origin": "null",
  2810. "protocol": "data:",
  2811. "username": "",
  2812. "password": "",
  2813. "host": "",
  2814. "hostname": "",
  2815. "port": "",
  2816. "pathname": "example.com/",
  2817. "search": "",
  2818. "hash": ""
  2819. },
  2820. {
  2821. "input": "javascript:example.com/",
  2822. "base": "about:blank",
  2823. "href": "javascript:example.com/",
  2824. "origin": "null",
  2825. "protocol": "javascript:",
  2826. "username": "",
  2827. "password": "",
  2828. "host": "",
  2829. "hostname": "",
  2830. "port": "",
  2831. "pathname": "example.com/",
  2832. "search": "",
  2833. "hash": ""
  2834. },
  2835. {
  2836. "input": "mailto:example.com/",
  2837. "base": "about:blank",
  2838. "href": "mailto:example.com/",
  2839. "origin": "null",
  2840. "protocol": "mailto:",
  2841. "username": "",
  2842. "password": "",
  2843. "host": "",
  2844. "hostname": "",
  2845. "port": "",
  2846. "pathname": "example.com/",
  2847. "search": "",
  2848. "hash": ""
  2849. },
  2850. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html",
  2851. {
  2852. "input": "http:@www.example.com",
  2853. "base": "about:blank",
  2854. "href": "http://www.example.com/",
  2855. "origin": "http://www.example.com",
  2856. "protocol": "http:",
  2857. "username": "",
  2858. "password": "",
  2859. "host": "www.example.com",
  2860. "hostname": "www.example.com",
  2861. "port": "",
  2862. "pathname": "/",
  2863. "search": "",
  2864. "hash": ""
  2865. },
  2866. {
  2867. "input": "http:/@www.example.com",
  2868. "base": "about:blank",
  2869. "href": "http://www.example.com/",
  2870. "origin": "http://www.example.com",
  2871. "protocol": "http:",
  2872. "username": "",
  2873. "password": "",
  2874. "host": "www.example.com",
  2875. "hostname": "www.example.com",
  2876. "port": "",
  2877. "pathname": "/",
  2878. "search": "",
  2879. "hash": ""
  2880. },
  2881. {
  2882. "input": "http://@www.example.com",
  2883. "base": "about:blank",
  2884. "href": "http://www.example.com/",
  2885. "origin": "http://www.example.com",
  2886. "protocol": "http:",
  2887. "username": "",
  2888. "password": "",
  2889. "host": "www.example.com",
  2890. "hostname": "www.example.com",
  2891. "port": "",
  2892. "pathname": "/",
  2893. "search": "",
  2894. "hash": ""
  2895. },
  2896. {
  2897. "input": "http:a:b@www.example.com",
  2898. "base": "about:blank",
  2899. "href": "http://a:b@www.example.com/",
  2900. "origin": "http://www.example.com",
  2901. "protocol": "http:",
  2902. "username": "a",
  2903. "password": "b",
  2904. "host": "www.example.com",
  2905. "hostname": "www.example.com",
  2906. "port": "",
  2907. "pathname": "/",
  2908. "search": "",
  2909. "hash": ""
  2910. },
  2911. {
  2912. "input": "http:/a:b@www.example.com",
  2913. "base": "about:blank",
  2914. "href": "http://a:b@www.example.com/",
  2915. "origin": "http://www.example.com",
  2916. "protocol": "http:",
  2917. "username": "a",
  2918. "password": "b",
  2919. "host": "www.example.com",
  2920. "hostname": "www.example.com",
  2921. "port": "",
  2922. "pathname": "/",
  2923. "search": "",
  2924. "hash": ""
  2925. },
  2926. {
  2927. "input": "http://a:b@www.example.com",
  2928. "base": "about:blank",
  2929. "href": "http://a:b@www.example.com/",
  2930. "origin": "http://www.example.com",
  2931. "protocol": "http:",
  2932. "username": "a",
  2933. "password": "b",
  2934. "host": "www.example.com",
  2935. "hostname": "www.example.com",
  2936. "port": "",
  2937. "pathname": "/",
  2938. "search": "",
  2939. "hash": ""
  2940. },
  2941. {
  2942. "input": "http://@pple.com",
  2943. "base": "about:blank",
  2944. "href": "http://pple.com/",
  2945. "origin": "http://pple.com",
  2946. "protocol": "http:",
  2947. "username": "",
  2948. "password": "",
  2949. "host": "pple.com",
  2950. "hostname": "pple.com",
  2951. "port": "",
  2952. "pathname": "/",
  2953. "search": "",
  2954. "hash": ""
  2955. },
  2956. {
  2957. "input": "http::b@www.example.com",
  2958. "base": "about:blank",
  2959. "href": "http://:b@www.example.com/",
  2960. "origin": "http://www.example.com",
  2961. "protocol": "http:",
  2962. "username": "",
  2963. "password": "b",
  2964. "host": "www.example.com",
  2965. "hostname": "www.example.com",
  2966. "port": "",
  2967. "pathname": "/",
  2968. "search": "",
  2969. "hash": ""
  2970. },
  2971. {
  2972. "input": "http:/:b@www.example.com",
  2973. "base": "about:blank",
  2974. "href": "http://:b@www.example.com/",
  2975. "origin": "http://www.example.com",
  2976. "protocol": "http:",
  2977. "username": "",
  2978. "password": "b",
  2979. "host": "www.example.com",
  2980. "hostname": "www.example.com",
  2981. "port": "",
  2982. "pathname": "/",
  2983. "search": "",
  2984. "hash": ""
  2985. },
  2986. {
  2987. "input": "http://:b@www.example.com",
  2988. "base": "about:blank",
  2989. "href": "http://:b@www.example.com/",
  2990. "origin": "http://www.example.com",
  2991. "protocol": "http:",
  2992. "username": "",
  2993. "password": "b",
  2994. "host": "www.example.com",
  2995. "hostname": "www.example.com",
  2996. "port": "",
  2997. "pathname": "/",
  2998. "search": "",
  2999. "hash": ""
  3000. },
  3001. {
  3002. "input": "http:/:@/www.example.com",
  3003. "base": "about:blank",
  3004. "failure": true
  3005. },
  3006. {
  3007. "input": "http://user@/www.example.com",
  3008. "base": "about:blank",
  3009. "failure": true
  3010. },
  3011. {
  3012. "input": "http:@/www.example.com",
  3013. "base": "about:blank",
  3014. "failure": true
  3015. },
  3016. {
  3017. "input": "http:/@/www.example.com",
  3018. "base": "about:blank",
  3019. "failure": true
  3020. },
  3021. {
  3022. "input": "http://@/www.example.com",
  3023. "base": "about:blank",
  3024. "failure": true
  3025. },
  3026. {
  3027. "input": "https:@/www.example.com",
  3028. "base": "about:blank",
  3029. "failure": true
  3030. },
  3031. {
  3032. "input": "http:a:b@/www.example.com",
  3033. "base": "about:blank",
  3034. "failure": true
  3035. },
  3036. {
  3037. "input": "http:/a:b@/www.example.com",
  3038. "base": "about:blank",
  3039. "failure": true
  3040. },
  3041. {
  3042. "input": "http://a:b@/www.example.com",
  3043. "base": "about:blank",
  3044. "failure": true
  3045. },
  3046. {
  3047. "input": "http::@/www.example.com",
  3048. "base": "about:blank",
  3049. "failure": true
  3050. },
  3051. {
  3052. "input": "http:a:@www.example.com",
  3053. "base": "about:blank",
  3054. "href": "http://a:@www.example.com/",
  3055. "origin": "http://www.example.com",
  3056. "protocol": "http:",
  3057. "username": "a",
  3058. "password": "",
  3059. "host": "www.example.com",
  3060. "hostname": "www.example.com",
  3061. "port": "",
  3062. "pathname": "/",
  3063. "search": "",
  3064. "hash": ""
  3065. },
  3066. {
  3067. "input": "http:/a:@www.example.com",
  3068. "base": "about:blank",
  3069. "href": "http://a:@www.example.com/",
  3070. "origin": "http://www.example.com",
  3071. "protocol": "http:",
  3072. "username": "a",
  3073. "password": "",
  3074. "host": "www.example.com",
  3075. "hostname": "www.example.com",
  3076. "port": "",
  3077. "pathname": "/",
  3078. "search": "",
  3079. "hash": ""
  3080. },
  3081. {
  3082. "input": "http://a:@www.example.com",
  3083. "base": "about:blank",
  3084. "href": "http://a:@www.example.com/",
  3085. "origin": "http://www.example.com",
  3086. "protocol": "http:",
  3087. "username": "a",
  3088. "password": "",
  3089. "host": "www.example.com",
  3090. "hostname": "www.example.com",
  3091. "port": "",
  3092. "pathname": "/",
  3093. "search": "",
  3094. "hash": ""
  3095. },
  3096. {
  3097. "input": "http://www.@pple.com",
  3098. "base": "about:blank",
  3099. "href": "http://www.@pple.com/",
  3100. "origin": "http://pple.com",
  3101. "protocol": "http:",
  3102. "username": "www.",
  3103. "password": "",
  3104. "host": "pple.com",
  3105. "hostname": "pple.com",
  3106. "port": "",
  3107. "pathname": "/",
  3108. "search": "",
  3109. "hash": ""
  3110. },
  3111. {
  3112. "input": "http:@:www.example.com",
  3113. "base": "about:blank",
  3114. "failure": true
  3115. },
  3116. {
  3117. "input": "http:/@:www.example.com",
  3118. "base": "about:blank",
  3119. "failure": true
  3120. },
  3121. {
  3122. "input": "http://@:www.example.com",
  3123. "base": "about:blank",
  3124. "failure": true
  3125. },
  3126. {
  3127. "input": "http://:@www.example.com",
  3128. "base": "about:blank",
  3129. "href": "http://:@www.example.com/",
  3130. "origin": "http://www.example.com",
  3131. "protocol": "http:",
  3132. "username": "",
  3133. "password": "",
  3134. "host": "www.example.com",
  3135. "hostname": "www.example.com",
  3136. "port": "",
  3137. "pathname": "/",
  3138. "search": "",
  3139. "hash": ""
  3140. },
  3141. "# Others",
  3142. {
  3143. "input": "/",
  3144. "base": "http://www.example.com/test",
  3145. "href": "http://www.example.com/",
  3146. "origin": "http://www.example.com",
  3147. "protocol": "http:",
  3148. "username": "",
  3149. "password": "",
  3150. "host": "www.example.com",
  3151. "hostname": "www.example.com",
  3152. "port": "",
  3153. "pathname": "/",
  3154. "search": "",
  3155. "hash": ""
  3156. },
  3157. {
  3158. "input": "/test.txt",
  3159. "base": "http://www.example.com/test",
  3160. "href": "http://www.example.com/test.txt",
  3161. "origin": "http://www.example.com",
  3162. "protocol": "http:",
  3163. "username": "",
  3164. "password": "",
  3165. "host": "www.example.com",
  3166. "hostname": "www.example.com",
  3167. "port": "",
  3168. "pathname": "/test.txt",
  3169. "search": "",
  3170. "hash": ""
  3171. },
  3172. {
  3173. "input": ".",
  3174. "base": "http://www.example.com/test",
  3175. "href": "http://www.example.com/",
  3176. "origin": "http://www.example.com",
  3177. "protocol": "http:",
  3178. "username": "",
  3179. "password": "",
  3180. "host": "www.example.com",
  3181. "hostname": "www.example.com",
  3182. "port": "",
  3183. "pathname": "/",
  3184. "search": "",
  3185. "hash": ""
  3186. },
  3187. {
  3188. "input": "..",
  3189. "base": "http://www.example.com/test",
  3190. "href": "http://www.example.com/",
  3191. "origin": "http://www.example.com",
  3192. "protocol": "http:",
  3193. "username": "",
  3194. "password": "",
  3195. "host": "www.example.com",
  3196. "hostname": "www.example.com",
  3197. "port": "",
  3198. "pathname": "/",
  3199. "search": "",
  3200. "hash": ""
  3201. },
  3202. {
  3203. "input": "test.txt",
  3204. "base": "http://www.example.com/test",
  3205. "href": "http://www.example.com/test.txt",
  3206. "origin": "http://www.example.com",
  3207. "protocol": "http:",
  3208. "username": "",
  3209. "password": "",
  3210. "host": "www.example.com",
  3211. "hostname": "www.example.com",
  3212. "port": "",
  3213. "pathname": "/test.txt",
  3214. "search": "",
  3215. "hash": ""
  3216. },
  3217. {
  3218. "input": "./test.txt",
  3219. "base": "http://www.example.com/test",
  3220. "href": "http://www.example.com/test.txt",
  3221. "origin": "http://www.example.com",
  3222. "protocol": "http:",
  3223. "username": "",
  3224. "password": "",
  3225. "host": "www.example.com",
  3226. "hostname": "www.example.com",
  3227. "port": "",
  3228. "pathname": "/test.txt",
  3229. "search": "",
  3230. "hash": ""
  3231. },
  3232. {
  3233. "input": "../test.txt",
  3234. "base": "http://www.example.com/test",
  3235. "href": "http://www.example.com/test.txt",
  3236. "origin": "http://www.example.com",
  3237. "protocol": "http:",
  3238. "username": "",
  3239. "password": "",
  3240. "host": "www.example.com",
  3241. "hostname": "www.example.com",
  3242. "port": "",
  3243. "pathname": "/test.txt",
  3244. "search": "",
  3245. "hash": ""
  3246. },
  3247. {
  3248. "input": "../aaa/test.txt",
  3249. "base": "http://www.example.com/test",
  3250. "href": "http://www.example.com/aaa/test.txt",
  3251. "origin": "http://www.example.com",
  3252. "protocol": "http:",
  3253. "username": "",
  3254. "password": "",
  3255. "host": "www.example.com",
  3256. "hostname": "www.example.com",
  3257. "port": "",
  3258. "pathname": "/aaa/test.txt",
  3259. "search": "",
  3260. "hash": ""
  3261. },
  3262. {
  3263. "input": "../../test.txt",
  3264. "base": "http://www.example.com/test",
  3265. "href": "http://www.example.com/test.txt",
  3266. "origin": "http://www.example.com",
  3267. "protocol": "http:",
  3268. "username": "",
  3269. "password": "",
  3270. "host": "www.example.com",
  3271. "hostname": "www.example.com",
  3272. "port": "",
  3273. "pathname": "/test.txt",
  3274. "search": "",
  3275. "hash": ""
  3276. },
  3277. {
  3278. "input": "中/test.txt",
  3279. "base": "http://www.example.com/test",
  3280. "href": "http://www.example.com/%E4%B8%AD/test.txt",
  3281. "origin": "http://www.example.com",
  3282. "protocol": "http:",
  3283. "username": "",
  3284. "password": "",
  3285. "host": "www.example.com",
  3286. "hostname": "www.example.com",
  3287. "port": "",
  3288. "pathname": "/%E4%B8%AD/test.txt",
  3289. "search": "",
  3290. "hash": ""
  3291. },
  3292. {
  3293. "input": "http://www.example2.com",
  3294. "base": "http://www.example.com/test",
  3295. "href": "http://www.example2.com/",
  3296. "origin": "http://www.example2.com",
  3297. "protocol": "http:",
  3298. "username": "",
  3299. "password": "",
  3300. "host": "www.example2.com",
  3301. "hostname": "www.example2.com",
  3302. "port": "",
  3303. "pathname": "/",
  3304. "search": "",
  3305. "hash": ""
  3306. },
  3307. {
  3308. "input": "//www.example2.com",
  3309. "base": "http://www.example.com/test",
  3310. "href": "http://www.example2.com/",
  3311. "origin": "http://www.example2.com",
  3312. "protocol": "http:",
  3313. "username": "",
  3314. "password": "",
  3315. "host": "www.example2.com",
  3316. "hostname": "www.example2.com",
  3317. "port": "",
  3318. "pathname": "/",
  3319. "search": "",
  3320. "hash": ""
  3321. },
  3322. {
  3323. "input": "file:...",
  3324. "base": "http://www.example.com/test",
  3325. "href": "file:///...",
  3326. "protocol": "file:",
  3327. "username": "",
  3328. "password": "",
  3329. "host": "",
  3330. "hostname": "",
  3331. "port": "",
  3332. "pathname": "/...",
  3333. "search": "",
  3334. "hash": ""
  3335. },
  3336. {
  3337. "input": "file:..",
  3338. "base": "http://www.example.com/test",
  3339. "href": "file:///",
  3340. "protocol": "file:",
  3341. "username": "",
  3342. "password": "",
  3343. "host": "",
  3344. "hostname": "",
  3345. "port": "",
  3346. "pathname": "/",
  3347. "search": "",
  3348. "hash": ""
  3349. },
  3350. {
  3351. "input": "file:a",
  3352. "base": "http://www.example.com/test",
  3353. "href": "file:///a",
  3354. "protocol": "file:",
  3355. "username": "",
  3356. "password": "",
  3357. "host": "",
  3358. "hostname": "",
  3359. "port": "",
  3360. "pathname": "/a",
  3361. "search": "",
  3362. "hash": ""
  3363. },
  3364. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
  3365. "Basic canonicalization, uppercase should be converted to lowercase",
  3366. {
  3367. "input": "http://ExAmPlE.CoM",
  3368. "base": "http://other.com/",
  3369. "href": "http://example.com/",
  3370. "origin": "http://example.com",
  3371. "protocol": "http:",
  3372. "username": "",
  3373. "password": "",
  3374. "host": "example.com",
  3375. "hostname": "example.com",
  3376. "port": "",
  3377. "pathname": "/",
  3378. "search": "",
  3379. "hash": ""
  3380. },
  3381. {
  3382. "input": "http://example example.com",
  3383. "base": "http://other.com/",
  3384. "failure": true
  3385. },
  3386. {
  3387. "input": "http://Goo%20 goo%7C|.com",
  3388. "base": "http://other.com/",
  3389. "failure": true
  3390. },
  3391. {
  3392. "input": "http://[]",
  3393. "base": "http://other.com/",
  3394. "failure": true
  3395. },
  3396. {
  3397. "input": "http://[:]",
  3398. "base": "http://other.com/",
  3399. "failure": true
  3400. },
  3401. "U+3000 is mapped to U+0020 (space) which is disallowed",
  3402. {
  3403. "input": "http://GOO\u00a0\u3000goo.com",
  3404. "base": "http://other.com/",
  3405. "failure": true
  3406. },
  3407. "Other types of space (no-break, zero-width, zero-width-no-break) are name-prepped away to nothing. U+200B, U+2060, and U+FEFF, are ignored",
  3408. {
  3409. "input": "http://GOO\u200b\u2060\ufeffgoo.com",
  3410. "base": "http://other.com/",
  3411. "href": "http://googoo.com/",
  3412. "origin": "http://googoo.com",
  3413. "protocol": "http:",
  3414. "username": "",
  3415. "password": "",
  3416. "host": "googoo.com",
  3417. "hostname": "googoo.com",
  3418. "port": "",
  3419. "pathname": "/",
  3420. "search": "",
  3421. "hash": ""
  3422. },
  3423. "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
  3424. {
  3425. "input": "http://www.foo。bar.com",
  3426. "base": "http://other.com/",
  3427. "href": "http://www.foo.bar.com/",
  3428. "origin": "http://www.foo.bar.com",
  3429. "protocol": "http:",
  3430. "username": "",
  3431. "password": "",
  3432. "host": "www.foo.bar.com",
  3433. "hostname": "www.foo.bar.com",
  3434. "port": "",
  3435. "pathname": "/",
  3436. "search": "",
  3437. "hash": ""
  3438. },
  3439. "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0",
  3440. {
  3441. "input": "http://\ufdd0zyx.com",
  3442. "base": "http://other.com/",
  3443. "failure": true
  3444. },
  3445. "This is the same as previous but escaped",
  3446. {
  3447. "input": "http://%ef%b7%90zyx.com",
  3448. "base": "http://other.com/",
  3449. "failure": true
  3450. },
  3451. "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.",
  3452. {
  3453. "input": "http://Go.com",
  3454. "base": "http://other.com/",
  3455. "href": "http://go.com/",
  3456. "origin": "http://go.com",
  3457. "protocol": "http:",
  3458. "username": "",
  3459. "password": "",
  3460. "host": "go.com",
  3461. "hostname": "go.com",
  3462. "port": "",
  3463. "pathname": "/",
  3464. "search": "",
  3465. "hash": ""
  3466. },
  3467. "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257",
  3468. {
  3469. "input": "http://%41.com",
  3470. "base": "http://other.com/",
  3471. "failure": true
  3472. },
  3473. {
  3474. "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com",
  3475. "base": "http://other.com/",
  3476. "failure": true
  3477. },
  3478. "...%00 in fullwidth should fail (also as escaped UTF-8 input)",
  3479. {
  3480. "input": "http://%00.com",
  3481. "base": "http://other.com/",
  3482. "failure": true
  3483. },
  3484. {
  3485. "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com",
  3486. "base": "http://other.com/",
  3487. "failure": true
  3488. },
  3489. "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
  3490. {
  3491. "input": "http://你好你好",
  3492. "base": "http://other.com/",
  3493. "href": "http://xn--6qqa088eba/",
  3494. "origin": "http://你好你好",
  3495. "protocol": "http:",
  3496. "username": "",
  3497. "password": "",
  3498. "host": "xn--6qqa088eba",
  3499. "hostname": "xn--6qqa088eba",
  3500. "port": "",
  3501. "pathname": "/",
  3502. "search": "",
  3503. "hash": ""
  3504. },
  3505. "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191",
  3506. {
  3507. "input": "http://%zz%66%a.com",
  3508. "base": "http://other.com/",
  3509. "failure": true
  3510. },
  3511. "If we get an invalid character that has been escaped.",
  3512. {
  3513. "input": "http://%25",
  3514. "base": "http://other.com/",
  3515. "failure": true
  3516. },
  3517. {
  3518. "input": "http://hello%00",
  3519. "base": "http://other.com/",
  3520. "failure": true
  3521. },
  3522. "Escaped numbers should be treated like IP addresses if they are.",
  3523. {
  3524. "input": "http://%30%78%63%30%2e%30%32%35%30.01",
  3525. "base": "http://other.com/",
  3526. "href": "http://192.168.0.1/",
  3527. "origin": "http://192.168.0.1",
  3528. "protocol": "http:",
  3529. "username": "",
  3530. "password": "",
  3531. "host": "192.168.0.1",
  3532. "hostname": "192.168.0.1",
  3533. "port": "",
  3534. "pathname": "/",
  3535. "search": "",
  3536. "hash": ""
  3537. },
  3538. {
  3539. "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e",
  3540. "base": "http://other.com/",
  3541. "href": "http://192.168.0.1/",
  3542. "origin": "http://192.168.0.1",
  3543. "protocol": "http:",
  3544. "username": "",
  3545. "password": "",
  3546. "host": "192.168.0.1",
  3547. "hostname": "192.168.0.1",
  3548. "port": "",
  3549. "pathname": "/",
  3550. "search": "",
  3551. "hash": ""
  3552. },
  3553. {
  3554. "input": "http://192.168.0.257",
  3555. "base": "http://other.com/",
  3556. "failure": true
  3557. },
  3558. "Invalid escaping should trigger the regular host error handling",
  3559. {
  3560. "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01",
  3561. "base": "http://other.com/",
  3562. "failure": true
  3563. },
  3564. "Something that isn't exactly an IP should get treated as a host and spaces escaped",
  3565. {
  3566. "input": "http://192.168.0.1 hello",
  3567. "base": "http://other.com/",
  3568. "failure": true
  3569. },
  3570. "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
  3571. {
  3572. "input": "http://0Xc0.0250.01",
  3573. "base": "http://other.com/",
  3574. "href": "http://192.168.0.1/",
  3575. "origin": "http://192.168.0.1",
  3576. "protocol": "http:",
  3577. "username": "",
  3578. "password": "",
  3579. "host": "192.168.0.1",
  3580. "hostname": "192.168.0.1",
  3581. "port": "",
  3582. "pathname": "/",
  3583. "search": "",
  3584. "hash": ""
  3585. },
  3586. "Broken IPv6",
  3587. {
  3588. "input": "http://[google.com]",
  3589. "base": "http://other.com/",
  3590. "failure": true
  3591. },
  3592. "Misc Unicode",
  3593. {
  3594. "input": "http://foo:💩@example.com/bar",
  3595. "base": "http://other.com/",
  3596. "href": "http://foo:%F0%9F%92%A9@example.com/bar",
  3597. "origin": "http://example.com",
  3598. "protocol": "http:",
  3599. "username": "foo",
  3600. "password": "%F0%9F%92%A9",
  3601. "host": "example.com",
  3602. "hostname": "example.com",
  3603. "port": "",
  3604. "pathname": "/bar",
  3605. "search": "",
  3606. "hash": ""
  3607. },
  3608. "# resolving a fragment against any scheme succeeds",
  3609. {
  3610. "input": "#",
  3611. "base": "test:test",
  3612. "href": "test:test#",
  3613. "origin": "null",
  3614. "protocol": "test:",
  3615. "username": "",
  3616. "password": "",
  3617. "host": "",
  3618. "hostname": "",
  3619. "port": "",
  3620. "pathname": "test",
  3621. "search": "",
  3622. "hash": ""
  3623. },
  3624. {
  3625. "input": "#x",
  3626. "base": "mailto:x@x.com",
  3627. "href": "mailto:x@x.com#x",
  3628. "origin": "null",
  3629. "protocol": "mailto:",
  3630. "username": "",
  3631. "password": "",
  3632. "host": "",
  3633. "hostname": "",
  3634. "port": "",
  3635. "pathname": "x@x.com",
  3636. "search": "",
  3637. "hash": "#x"
  3638. },
  3639. {
  3640. "input": "#x",
  3641. "base": "data:,",
  3642. "href": "data:,#x",
  3643. "origin": "null",
  3644. "protocol": "data:",
  3645. "username": "",
  3646. "password": "",
  3647. "host": "",
  3648. "hostname": "",
  3649. "port": "",
  3650. "pathname": ",",
  3651. "search": "",
  3652. "hash": "#x"
  3653. },
  3654. {
  3655. "input": "#x",
  3656. "base": "about:blank",
  3657. "href": "about:blank#x",
  3658. "origin": "null",
  3659. "protocol": "about:",
  3660. "username": "",
  3661. "password": "",
  3662. "host": "",
  3663. "hostname": "",
  3664. "port": "",
  3665. "pathname": "blank",
  3666. "search": "",
  3667. "hash": "#x"
  3668. },
  3669. {
  3670. "input": "#",
  3671. "base": "test:test?test",
  3672. "href": "test:test?test#",
  3673. "origin": "null",
  3674. "protocol": "test:",
  3675. "username": "",
  3676. "password": "",
  3677. "host": "",
  3678. "hostname": "",
  3679. "port": "",
  3680. "pathname": "test",
  3681. "search": "?test",
  3682. "hash": ""
  3683. },
  3684. "# multiple @ in authority state",
  3685. {
  3686. "input": "https://@test@test@example:800/",
  3687. "base": "http://doesnotmatter/",
  3688. "href": "https://%40test%40test@example:800/",
  3689. "origin": "https://example:800",
  3690. "protocol": "https:",
  3691. "username": "%40test%40test",
  3692. "password": "",
  3693. "host": "example:800",
  3694. "hostname": "example",
  3695. "port": "800",
  3696. "pathname": "/",
  3697. "search": "",
  3698. "hash": ""
  3699. },
  3700. {
  3701. "input": "https://@@@example",
  3702. "base": "http://doesnotmatter/",
  3703. "href": "https://%40%40@example/",
  3704. "origin": "https://example",
  3705. "protocol": "https:",
  3706. "username": "%40%40",
  3707. "password": "",
  3708. "host": "example",
  3709. "hostname": "example",
  3710. "port": "",
  3711. "pathname": "/",
  3712. "search": "",
  3713. "hash": ""
  3714. },
  3715. "non-az-09 characters",
  3716. {
  3717. "input": "http://`{}:`{}@h/`{}?`{}",
  3718. "base": "http://doesnotmatter/",
  3719. "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}",
  3720. "origin": "http://h",
  3721. "protocol": "http:",
  3722. "username": "%60%7B%7D",
  3723. "password": "%60%7B%7D",
  3724. "host": "h",
  3725. "hostname": "h",
  3726. "port": "",
  3727. "pathname": "/%60%7B%7D",
  3728. "search": "?`{}",
  3729. "hash": ""
  3730. },
  3731. "# Credentials in base",
  3732. {
  3733. "input": "/some/path",
  3734. "base": "http://user@example.org/smth",
  3735. "href": "http://user@example.org/some/path",
  3736. "origin": "http://example.org",
  3737. "protocol": "http:",
  3738. "username": "user",
  3739. "password": "",
  3740. "host": "example.org",
  3741. "hostname": "example.org",
  3742. "port": "",
  3743. "pathname": "/some/path",
  3744. "search": "",
  3745. "hash": ""
  3746. },
  3747. {
  3748. "input": "",
  3749. "base": "http://user:pass@example.org:21/smth",
  3750. "href": "http://user:pass@example.org:21/smth",
  3751. "origin": "http://example.org:21",
  3752. "protocol": "http:",
  3753. "username": "user",
  3754. "password": "pass",
  3755. "host": "example.org:21",
  3756. "hostname": "example.org",
  3757. "port": "21",
  3758. "pathname": "/smth",
  3759. "search": "",
  3760. "hash": ""
  3761. },
  3762. {
  3763. "input": "/some/path",
  3764. "base": "http://user:pass@example.org:21/smth",
  3765. "href": "http://user:pass@example.org:21/some/path",
  3766. "origin": "http://example.org:21",
  3767. "protocol": "http:",
  3768. "username": "user",
  3769. "password": "pass",
  3770. "host": "example.org:21",
  3771. "hostname": "example.org",
  3772. "port": "21",
  3773. "pathname": "/some/path",
  3774. "search": "",
  3775. "hash": ""
  3776. },
  3777. "# a set of tests designed by zcorpan for relative URLs with unknown schemes",
  3778. {
  3779. "input": "i",
  3780. "base": "sc:sd",
  3781. "failure": true
  3782. },
  3783. {
  3784. "input": "i",
  3785. "base": "sc:sd/sd",
  3786. "failure": true
  3787. },
  3788. {
  3789. "input": "i",
  3790. "base": "sc:/pa/pa",
  3791. "href": "sc:/pa/i",
  3792. "origin": "null",
  3793. "protocol": "sc:",
  3794. "username": "",
  3795. "password": "",
  3796. "host": "",
  3797. "hostname": "",
  3798. "port": "",
  3799. "pathname": "/pa/i",
  3800. "search": "",
  3801. "hash": ""
  3802. },
  3803. {
  3804. "input": "i",
  3805. "base": "sc://ho/pa",
  3806. "href": "sc://ho/i",
  3807. "origin": "null",
  3808. "protocol": "sc:",
  3809. "username": "",
  3810. "password": "",
  3811. "host": "ho",
  3812. "hostname": "ho",
  3813. "port": "",
  3814. "pathname": "/i",
  3815. "search": "",
  3816. "hash": ""
  3817. },
  3818. {
  3819. "input": "i",
  3820. "base": "sc:///pa/pa",
  3821. "href": "sc:///pa/i",
  3822. "origin": "null",
  3823. "protocol": "sc:",
  3824. "username": "",
  3825. "password": "",
  3826. "host": "",
  3827. "hostname": "",
  3828. "port": "",
  3829. "pathname": "/pa/i",
  3830. "search": "",
  3831. "hash": ""
  3832. },
  3833. {
  3834. "input": "../i",
  3835. "base": "sc:sd",
  3836. "failure": true
  3837. },
  3838. {
  3839. "input": "../i",
  3840. "base": "sc:sd/sd",
  3841. "failure": true
  3842. },
  3843. {
  3844. "input": "../i",
  3845. "base": "sc:/pa/pa",
  3846. "href": "sc:/i",
  3847. "origin": "null",
  3848. "protocol": "sc:",
  3849. "username": "",
  3850. "password": "",
  3851. "host": "",
  3852. "hostname": "",
  3853. "port": "",
  3854. "pathname": "/i",
  3855. "search": "",
  3856. "hash": ""
  3857. },
  3858. {
  3859. "input": "../i",
  3860. "base": "sc://ho/pa",
  3861. "href": "sc://ho/i",
  3862. "origin": "null",
  3863. "protocol": "sc:",
  3864. "username": "",
  3865. "password": "",
  3866. "host": "ho",
  3867. "hostname": "ho",
  3868. "port": "",
  3869. "pathname": "/i",
  3870. "search": "",
  3871. "hash": ""
  3872. },
  3873. {
  3874. "input": "../i",
  3875. "base": "sc:///pa/pa",
  3876. "href": "sc:///i",
  3877. "origin": "null",
  3878. "protocol": "sc:",
  3879. "username": "",
  3880. "password": "",
  3881. "host": "",
  3882. "hostname": "",
  3883. "port": "",
  3884. "pathname": "/i",
  3885. "search": "",
  3886. "hash": ""
  3887. },
  3888. {
  3889. "input": "/i",
  3890. "base": "sc:sd",
  3891. "failure": true
  3892. },
  3893. {
  3894. "input": "/i",
  3895. "base": "sc:sd/sd",
  3896. "failure": true
  3897. },
  3898. {
  3899. "input": "/i",
  3900. "base": "sc:/pa/pa",
  3901. "href": "sc:/i",
  3902. "origin": "null",
  3903. "protocol": "sc:",
  3904. "username": "",
  3905. "password": "",
  3906. "host": "",
  3907. "hostname": "",
  3908. "port": "",
  3909. "pathname": "/i",
  3910. "search": "",
  3911. "hash": ""
  3912. },
  3913. {
  3914. "input": "/i",
  3915. "base": "sc://ho/pa",
  3916. "href": "sc://ho/i",
  3917. "origin": "null",
  3918. "protocol": "sc:",
  3919. "username": "",
  3920. "password": "",
  3921. "host": "ho",
  3922. "hostname": "ho",
  3923. "port": "",
  3924. "pathname": "/i",
  3925. "search": "",
  3926. "hash": ""
  3927. },
  3928. {
  3929. "input": "/i",
  3930. "base": "sc:///pa/pa",
  3931. "href": "sc:///i",
  3932. "origin": "null",
  3933. "protocol": "sc:",
  3934. "username": "",
  3935. "password": "",
  3936. "host": "",
  3937. "hostname": "",
  3938. "port": "",
  3939. "pathname": "/i",
  3940. "search": "",
  3941. "hash": ""
  3942. },
  3943. {
  3944. "input": "?i",
  3945. "base": "sc:sd",
  3946. "failure": true
  3947. },
  3948. {
  3949. "input": "?i",
  3950. "base": "sc:sd/sd",
  3951. "failure": true
  3952. },
  3953. {
  3954. "input": "?i",
  3955. "base": "sc:/pa/pa",
  3956. "href": "sc:/pa/pa?i",
  3957. "origin": "null",
  3958. "protocol": "sc:",
  3959. "username": "",
  3960. "password": "",
  3961. "host": "",
  3962. "hostname": "",
  3963. "port": "",
  3964. "pathname": "/pa/pa",
  3965. "search": "?i",
  3966. "hash": ""
  3967. },
  3968. {
  3969. "input": "?i",
  3970. "base": "sc://ho/pa",
  3971. "href": "sc://ho/pa?i",
  3972. "origin": "null",
  3973. "protocol": "sc:",
  3974. "username": "",
  3975. "password": "",
  3976. "host": "ho",
  3977. "hostname": "ho",
  3978. "port": "",
  3979. "pathname": "/pa",
  3980. "search": "?i",
  3981. "hash": ""
  3982. },
  3983. {
  3984. "input": "?i",
  3985. "base": "sc:///pa/pa",
  3986. "href": "sc:///pa/pa?i",
  3987. "origin": "null",
  3988. "protocol": "sc:",
  3989. "username": "",
  3990. "password": "",
  3991. "host": "",
  3992. "hostname": "",
  3993. "port": "",
  3994. "pathname": "/pa/pa",
  3995. "search": "?i",
  3996. "hash": ""
  3997. },
  3998. {
  3999. "input": "#i",
  4000. "base": "sc:sd",
  4001. "href": "sc:sd#i",
  4002. "origin": "null",
  4003. "protocol": "sc:",
  4004. "username": "",
  4005. "password": "",
  4006. "host": "",
  4007. "hostname": "",
  4008. "port": "",
  4009. "pathname": "sd",
  4010. "search": "",
  4011. "hash": "#i"
  4012. },
  4013. {
  4014. "input": "#i",
  4015. "base": "sc:sd/sd",
  4016. "href": "sc:sd/sd#i",
  4017. "origin": "null",
  4018. "protocol": "sc:",
  4019. "username": "",
  4020. "password": "",
  4021. "host": "",
  4022. "hostname": "",
  4023. "port": "",
  4024. "pathname": "sd/sd",
  4025. "search": "",
  4026. "hash": "#i"
  4027. },
  4028. {
  4029. "input": "#i",
  4030. "base": "sc:/pa/pa",
  4031. "href": "sc:/pa/pa#i",
  4032. "origin": "null",
  4033. "protocol": "sc:",
  4034. "username": "",
  4035. "password": "",
  4036. "host": "",
  4037. "hostname": "",
  4038. "port": "",
  4039. "pathname": "/pa/pa",
  4040. "search": "",
  4041. "hash": "#i"
  4042. },
  4043. {
  4044. "input": "#i",
  4045. "base": "sc://ho/pa",
  4046. "href": "sc://ho/pa#i",
  4047. "origin": "null",
  4048. "protocol": "sc:",
  4049. "username": "",
  4050. "password": "",
  4051. "host": "ho",
  4052. "hostname": "ho",
  4053. "port": "",
  4054. "pathname": "/pa",
  4055. "search": "",
  4056. "hash": "#i"
  4057. },
  4058. {
  4059. "input": "#i",
  4060. "base": "sc:///pa/pa",
  4061. "href": "sc:///pa/pa#i",
  4062. "origin": "null",
  4063. "protocol": "sc:",
  4064. "username": "",
  4065. "password": "",
  4066. "host": "",
  4067. "hostname": "",
  4068. "port": "",
  4069. "pathname": "/pa/pa",
  4070. "search": "",
  4071. "hash": "#i"
  4072. },
  4073. "# make sure that relative URL logic works on known typically non-relative schemes too",
  4074. {
  4075. "input": "about:/../",
  4076. "base": "about:blank",
  4077. "href": "about:/",
  4078. "origin": "null",
  4079. "protocol": "about:",
  4080. "username": "",
  4081. "password": "",
  4082. "host": "",
  4083. "hostname": "",
  4084. "port": "",
  4085. "pathname": "/",
  4086. "search": "",
  4087. "hash": ""
  4088. },
  4089. {
  4090. "input": "data:/../",
  4091. "base": "about:blank",
  4092. "href": "data:/",
  4093. "origin": "null",
  4094. "protocol": "data:",
  4095. "username": "",
  4096. "password": "",
  4097. "host": "",
  4098. "hostname": "",
  4099. "port": "",
  4100. "pathname": "/",
  4101. "search": "",
  4102. "hash": ""
  4103. },
  4104. {
  4105. "input": "javascript:/../",
  4106. "base": "about:blank",
  4107. "href": "javascript:/",
  4108. "origin": "null",
  4109. "protocol": "javascript:",
  4110. "username": "",
  4111. "password": "",
  4112. "host": "",
  4113. "hostname": "",
  4114. "port": "",
  4115. "pathname": "/",
  4116. "search": "",
  4117. "hash": ""
  4118. },
  4119. {
  4120. "input": "mailto:/../",
  4121. "base": "about:blank",
  4122. "href": "mailto:/",
  4123. "origin": "null",
  4124. "protocol": "mailto:",
  4125. "username": "",
  4126. "password": "",
  4127. "host": "",
  4128. "hostname": "",
  4129. "port": "",
  4130. "pathname": "/",
  4131. "search": "",
  4132. "hash": ""
  4133. },
  4134. "# unknown schemes and non-ASCII domains",
  4135. {
  4136. "input": "sc://ñ.test/",
  4137. "base": "about:blank",
  4138. "href": "sc://xn--ida.test/",
  4139. "origin": "null",
  4140. "protocol": "sc:",
  4141. "username": "",
  4142. "password": "",
  4143. "host": "xn--ida.test",
  4144. "hostname": "xn--ida.test",
  4145. "port": "",
  4146. "pathname": "/",
  4147. "search": "",
  4148. "hash": ""
  4149. },
  4150. "# unknown schemes and backslashes",
  4151. {
  4152. "input": "sc:\\../",
  4153. "base": "about:blank",
  4154. "href": "sc:\\../",
  4155. "origin": "null",
  4156. "protocol": "sc:",
  4157. "username": "",
  4158. "password": "",
  4159. "host": "",
  4160. "hostname": "",
  4161. "port": "",
  4162. "pathname": "\\../",
  4163. "search": "",
  4164. "hash": ""
  4165. },
  4166. "# tests from jsdom/whatwg-url designed for code coverage",
  4167. {
  4168. "input": "http://127.0.0.1:10100/relative_import.html",
  4169. "base": "about:blank",
  4170. "href": "http://127.0.0.1:10100/relative_import.html",
  4171. "origin": "http://127.0.0.1:10100",
  4172. "protocol": "http:",
  4173. "username": "",
  4174. "password": "",
  4175. "host": "127.0.0.1:10100",
  4176. "hostname": "127.0.0.1",
  4177. "port": "10100",
  4178. "pathname": "/relative_import.html",
  4179. "search": "",
  4180. "hash": ""
  4181. },
  4182. {
  4183. "input": "http://facebook.com/?foo=%7B%22abc%22",
  4184. "base": "about:blank",
  4185. "href": "http://facebook.com/?foo=%7B%22abc%22",
  4186. "origin": "http://facebook.com",
  4187. "protocol": "http:",
  4188. "username": "",
  4189. "password": "",
  4190. "host": "facebook.com",
  4191. "hostname": "facebook.com",
  4192. "port": "",
  4193. "pathname": "/",
  4194. "search": "?foo=%7B%22abc%22",
  4195. "hash": ""
  4196. },
  4197. {
  4198. "input": "https://localhost:3000/jqueryui@1.2.3",
  4199. "base": "about:blank",
  4200. "href": "https://localhost:3000/jqueryui@1.2.3",
  4201. "origin": "https://localhost:3000",
  4202. "protocol": "https:",
  4203. "username": "",
  4204. "password": "",
  4205. "host": "localhost:3000",
  4206. "hostname": "localhost",
  4207. "port": "3000",
  4208. "pathname": "/jqueryui@1.2.3",
  4209. "search": "",
  4210. "hash": ""
  4211. }
  4212. ]