urltestdata.json 97 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377
  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://[::127.0.0.1]",
  845. "base": "http://example.org/foo/bar",
  846. "href": "http://[::7f00:1]/",
  847. "origin": "http://[::7f00:1]",
  848. "protocol": "http:",
  849. "username": "",
  850. "password": "",
  851. "host": "[::7f00:1]",
  852. "hostname": "[::7f00:1]",
  853. "port": "",
  854. "pathname": "/",
  855. "search": "",
  856. "hash": ""
  857. },
  858. {
  859. "input": "http://[0:0:0:0:0:0:13.1.68.3]",
  860. "base": "http://example.org/foo/bar",
  861. "href": "http://[::d01:4403]/",
  862. "origin": "http://[::d01:4403]",
  863. "protocol": "http:",
  864. "username": "",
  865. "password": "",
  866. "host": "[::d01:4403]",
  867. "hostname": "[::d01:4403]",
  868. "port": "",
  869. "pathname": "/",
  870. "search": "",
  871. "hash": ""
  872. },
  873. {
  874. "input": "http://[2001::1]:80",
  875. "base": "http://example.org/foo/bar",
  876. "href": "http://[2001::1]/",
  877. "origin": "http://[2001::1]",
  878. "protocol": "http:",
  879. "username": "",
  880. "password": "",
  881. "host": "[2001::1]",
  882. "hostname": "[2001::1]",
  883. "port": "",
  884. "pathname": "/",
  885. "search": "",
  886. "hash": ""
  887. },
  888. {
  889. "input": "http:/example.com/",
  890. "base": "http://example.org/foo/bar",
  891. "href": "http://example.org/example.com/",
  892. "origin": "http://example.org",
  893. "protocol": "http:",
  894. "username": "",
  895. "password": "",
  896. "host": "example.org",
  897. "hostname": "example.org",
  898. "port": "",
  899. "pathname": "/example.com/",
  900. "search": "",
  901. "hash": ""
  902. },
  903. {
  904. "input": "ftp:/example.com/",
  905. "base": "http://example.org/foo/bar",
  906. "href": "ftp://example.com/",
  907. "origin": "ftp://example.com",
  908. "protocol": "ftp:",
  909. "username": "",
  910. "password": "",
  911. "host": "example.com",
  912. "hostname": "example.com",
  913. "port": "",
  914. "pathname": "/",
  915. "search": "",
  916. "hash": ""
  917. },
  918. {
  919. "input": "https:/example.com/",
  920. "base": "http://example.org/foo/bar",
  921. "href": "https://example.com/",
  922. "origin": "https://example.com",
  923. "protocol": "https:",
  924. "username": "",
  925. "password": "",
  926. "host": "example.com",
  927. "hostname": "example.com",
  928. "port": "",
  929. "pathname": "/",
  930. "search": "",
  931. "hash": ""
  932. },
  933. {
  934. "input": "madeupscheme:/example.com/",
  935. "base": "http://example.org/foo/bar",
  936. "href": "madeupscheme:/example.com/",
  937. "origin": "null",
  938. "protocol": "madeupscheme:",
  939. "username": "",
  940. "password": "",
  941. "host": "",
  942. "hostname": "",
  943. "port": "",
  944. "pathname": "/example.com/",
  945. "search": "",
  946. "hash": ""
  947. },
  948. {
  949. "input": "file:/example.com/",
  950. "base": "http://example.org/foo/bar",
  951. "href": "file:///example.com/",
  952. "protocol": "file:",
  953. "username": "",
  954. "password": "",
  955. "host": "",
  956. "hostname": "",
  957. "port": "",
  958. "pathname": "/example.com/",
  959. "search": "",
  960. "hash": ""
  961. },
  962. {
  963. "input": "ftps:/example.com/",
  964. "base": "http://example.org/foo/bar",
  965. "href": "ftps:/example.com/",
  966. "origin": "null",
  967. "protocol": "ftps:",
  968. "username": "",
  969. "password": "",
  970. "host": "",
  971. "hostname": "",
  972. "port": "",
  973. "pathname": "/example.com/",
  974. "search": "",
  975. "hash": ""
  976. },
  977. {
  978. "input": "gopher:/example.com/",
  979. "base": "http://example.org/foo/bar",
  980. "href": "gopher://example.com/",
  981. "origin": "gopher://example.com",
  982. "protocol": "gopher:",
  983. "username": "",
  984. "password": "",
  985. "host": "example.com",
  986. "hostname": "example.com",
  987. "port": "",
  988. "pathname": "/",
  989. "search": "",
  990. "hash": ""
  991. },
  992. {
  993. "input": "ws:/example.com/",
  994. "base": "http://example.org/foo/bar",
  995. "href": "ws://example.com/",
  996. "origin": "ws://example.com",
  997. "protocol": "ws:",
  998. "username": "",
  999. "password": "",
  1000. "host": "example.com",
  1001. "hostname": "example.com",
  1002. "port": "",
  1003. "pathname": "/",
  1004. "search": "",
  1005. "hash": ""
  1006. },
  1007. {
  1008. "input": "wss:/example.com/",
  1009. "base": "http://example.org/foo/bar",
  1010. "href": "wss://example.com/",
  1011. "origin": "wss://example.com",
  1012. "protocol": "wss:",
  1013. "username": "",
  1014. "password": "",
  1015. "host": "example.com",
  1016. "hostname": "example.com",
  1017. "port": "",
  1018. "pathname": "/",
  1019. "search": "",
  1020. "hash": ""
  1021. },
  1022. {
  1023. "input": "data:/example.com/",
  1024. "base": "http://example.org/foo/bar",
  1025. "href": "data:/example.com/",
  1026. "origin": "null",
  1027. "protocol": "data:",
  1028. "username": "",
  1029. "password": "",
  1030. "host": "",
  1031. "hostname": "",
  1032. "port": "",
  1033. "pathname": "/example.com/",
  1034. "search": "",
  1035. "hash": ""
  1036. },
  1037. {
  1038. "input": "javascript:/example.com/",
  1039. "base": "http://example.org/foo/bar",
  1040. "href": "javascript:/example.com/",
  1041. "origin": "null",
  1042. "protocol": "javascript:",
  1043. "username": "",
  1044. "password": "",
  1045. "host": "",
  1046. "hostname": "",
  1047. "port": "",
  1048. "pathname": "/example.com/",
  1049. "search": "",
  1050. "hash": ""
  1051. },
  1052. {
  1053. "input": "mailto:/example.com/",
  1054. "base": "http://example.org/foo/bar",
  1055. "href": "mailto:/example.com/",
  1056. "origin": "null",
  1057. "protocol": "mailto:",
  1058. "username": "",
  1059. "password": "",
  1060. "host": "",
  1061. "hostname": "",
  1062. "port": "",
  1063. "pathname": "/example.com/",
  1064. "search": "",
  1065. "hash": ""
  1066. },
  1067. {
  1068. "input": "http:example.com/",
  1069. "base": "http://example.org/foo/bar",
  1070. "href": "http://example.org/foo/example.com/",
  1071. "origin": "http://example.org",
  1072. "protocol": "http:",
  1073. "username": "",
  1074. "password": "",
  1075. "host": "example.org",
  1076. "hostname": "example.org",
  1077. "port": "",
  1078. "pathname": "/foo/example.com/",
  1079. "search": "",
  1080. "hash": ""
  1081. },
  1082. {
  1083. "input": "ftp:example.com/",
  1084. "base": "http://example.org/foo/bar",
  1085. "href": "ftp://example.com/",
  1086. "origin": "ftp://example.com",
  1087. "protocol": "ftp:",
  1088. "username": "",
  1089. "password": "",
  1090. "host": "example.com",
  1091. "hostname": "example.com",
  1092. "port": "",
  1093. "pathname": "/",
  1094. "search": "",
  1095. "hash": ""
  1096. },
  1097. {
  1098. "input": "https:example.com/",
  1099. "base": "http://example.org/foo/bar",
  1100. "href": "https://example.com/",
  1101. "origin": "https://example.com",
  1102. "protocol": "https:",
  1103. "username": "",
  1104. "password": "",
  1105. "host": "example.com",
  1106. "hostname": "example.com",
  1107. "port": "",
  1108. "pathname": "/",
  1109. "search": "",
  1110. "hash": ""
  1111. },
  1112. {
  1113. "input": "madeupscheme:example.com/",
  1114. "base": "http://example.org/foo/bar",
  1115. "href": "madeupscheme:example.com/",
  1116. "origin": "null",
  1117. "protocol": "madeupscheme:",
  1118. "username": "",
  1119. "password": "",
  1120. "host": "",
  1121. "hostname": "",
  1122. "port": "",
  1123. "pathname": "example.com/",
  1124. "search": "",
  1125. "hash": ""
  1126. },
  1127. {
  1128. "input": "ftps:example.com/",
  1129. "base": "http://example.org/foo/bar",
  1130. "href": "ftps:example.com/",
  1131. "origin": "null",
  1132. "protocol": "ftps:",
  1133. "username": "",
  1134. "password": "",
  1135. "host": "",
  1136. "hostname": "",
  1137. "port": "",
  1138. "pathname": "example.com/",
  1139. "search": "",
  1140. "hash": ""
  1141. },
  1142. {
  1143. "input": "gopher:example.com/",
  1144. "base": "http://example.org/foo/bar",
  1145. "href": "gopher://example.com/",
  1146. "origin": "gopher://example.com",
  1147. "protocol": "gopher:",
  1148. "username": "",
  1149. "password": "",
  1150. "host": "example.com",
  1151. "hostname": "example.com",
  1152. "port": "",
  1153. "pathname": "/",
  1154. "search": "",
  1155. "hash": ""
  1156. },
  1157. {
  1158. "input": "ws:example.com/",
  1159. "base": "http://example.org/foo/bar",
  1160. "href": "ws://example.com/",
  1161. "origin": "ws://example.com",
  1162. "protocol": "ws:",
  1163. "username": "",
  1164. "password": "",
  1165. "host": "example.com",
  1166. "hostname": "example.com",
  1167. "port": "",
  1168. "pathname": "/",
  1169. "search": "",
  1170. "hash": ""
  1171. },
  1172. {
  1173. "input": "wss:example.com/",
  1174. "base": "http://example.org/foo/bar",
  1175. "href": "wss://example.com/",
  1176. "origin": "wss://example.com",
  1177. "protocol": "wss:",
  1178. "username": "",
  1179. "password": "",
  1180. "host": "example.com",
  1181. "hostname": "example.com",
  1182. "port": "",
  1183. "pathname": "/",
  1184. "search": "",
  1185. "hash": ""
  1186. },
  1187. {
  1188. "input": "data:example.com/",
  1189. "base": "http://example.org/foo/bar",
  1190. "href": "data:example.com/",
  1191. "origin": "null",
  1192. "protocol": "data:",
  1193. "username": "",
  1194. "password": "",
  1195. "host": "",
  1196. "hostname": "",
  1197. "port": "",
  1198. "pathname": "example.com/",
  1199. "search": "",
  1200. "hash": ""
  1201. },
  1202. {
  1203. "input": "javascript:example.com/",
  1204. "base": "http://example.org/foo/bar",
  1205. "href": "javascript:example.com/",
  1206. "origin": "null",
  1207. "protocol": "javascript:",
  1208. "username": "",
  1209. "password": "",
  1210. "host": "",
  1211. "hostname": "",
  1212. "port": "",
  1213. "pathname": "example.com/",
  1214. "search": "",
  1215. "hash": ""
  1216. },
  1217. {
  1218. "input": "mailto:example.com/",
  1219. "base": "http://example.org/foo/bar",
  1220. "href": "mailto:example.com/",
  1221. "origin": "null",
  1222. "protocol": "mailto:",
  1223. "username": "",
  1224. "password": "",
  1225. "host": "",
  1226. "hostname": "",
  1227. "port": "",
  1228. "pathname": "example.com/",
  1229. "search": "",
  1230. "hash": ""
  1231. },
  1232. {
  1233. "input": "/a/b/c",
  1234. "base": "http://example.org/foo/bar",
  1235. "href": "http://example.org/a/b/c",
  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/b/c",
  1244. "search": "",
  1245. "hash": ""
  1246. },
  1247. {
  1248. "input": "/a/ /c",
  1249. "base": "http://example.org/foo/bar",
  1250. "href": "http://example.org/a/%20/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/%20/c",
  1259. "search": "",
  1260. "hash": ""
  1261. },
  1262. {
  1263. "input": "/a%2fc",
  1264. "base": "http://example.org/foo/bar",
  1265. "href": "http://example.org/a%2fc",
  1266. "origin": "http://example.org",
  1267. "protocol": "http:",
  1268. "username": "",
  1269. "password": "",
  1270. "host": "example.org",
  1271. "hostname": "example.org",
  1272. "port": "",
  1273. "pathname": "/a%2fc",
  1274. "search": "",
  1275. "hash": ""
  1276. },
  1277. {
  1278. "input": "/a/%2f/c",
  1279. "base": "http://example.org/foo/bar",
  1280. "href": "http://example.org/a/%2f/c",
  1281. "origin": "http://example.org",
  1282. "protocol": "http:",
  1283. "username": "",
  1284. "password": "",
  1285. "host": "example.org",
  1286. "hostname": "example.org",
  1287. "port": "",
  1288. "pathname": "/a/%2f/c",
  1289. "search": "",
  1290. "hash": ""
  1291. },
  1292. {
  1293. "input": "#β",
  1294. "base": "http://example.org/foo/bar",
  1295. "href": "http://example.org/foo/bar#%CE%B2",
  1296. "origin": "http://example.org",
  1297. "protocol": "http:",
  1298. "username": "",
  1299. "password": "",
  1300. "host": "example.org",
  1301. "hostname": "example.org",
  1302. "port": "",
  1303. "pathname": "/foo/bar",
  1304. "search": "",
  1305. "hash": "#%CE%B2"
  1306. },
  1307. {
  1308. "input": "data:text/html,test#test",
  1309. "base": "http://example.org/foo/bar",
  1310. "href": "data:text/html,test#test",
  1311. "origin": "null",
  1312. "protocol": "data:",
  1313. "username": "",
  1314. "password": "",
  1315. "host": "",
  1316. "hostname": "",
  1317. "port": "",
  1318. "pathname": "text/html,test",
  1319. "search": "",
  1320. "hash": "#test"
  1321. },
  1322. {
  1323. "input": "tel:1234567890",
  1324. "base": "http://example.org/foo/bar",
  1325. "href": "tel:1234567890",
  1326. "origin": "null",
  1327. "protocol": "tel:",
  1328. "username": "",
  1329. "password": "",
  1330. "host": "",
  1331. "hostname": "",
  1332. "port": "",
  1333. "pathname": "1234567890",
  1334. "search": "",
  1335. "hash": ""
  1336. },
  1337. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
  1338. {
  1339. "input": "file:c:\\foo\\bar.html",
  1340. "base": "file:///tmp/mock/path",
  1341. "href": "file:///c:/foo/bar.html",
  1342. "protocol": "file:",
  1343. "username": "",
  1344. "password": "",
  1345. "host": "",
  1346. "hostname": "",
  1347. "port": "",
  1348. "pathname": "/c:/foo/bar.html",
  1349. "search": "",
  1350. "hash": ""
  1351. },
  1352. {
  1353. "input": " File:c|////foo\\bar.html",
  1354. "base": "file:///tmp/mock/path",
  1355. "href": "file:///c:////foo/bar.html",
  1356. "protocol": "file:",
  1357. "username": "",
  1358. "password": "",
  1359. "host": "",
  1360. "hostname": "",
  1361. "port": "",
  1362. "pathname": "/c:////foo/bar.html",
  1363. "search": "",
  1364. "hash": ""
  1365. },
  1366. {
  1367. "input": "C|/foo/bar",
  1368. "base": "file:///tmp/mock/path",
  1369. "href": "file:///C:/foo/bar",
  1370. "protocol": "file:",
  1371. "username": "",
  1372. "password": "",
  1373. "host": "",
  1374. "hostname": "",
  1375. "port": "",
  1376. "pathname": "/C:/foo/bar",
  1377. "search": "",
  1378. "hash": ""
  1379. },
  1380. {
  1381. "input": "/C|\\foo\\bar",
  1382. "base": "file:///tmp/mock/path",
  1383. "href": "file:///C:/foo/bar",
  1384. "protocol": "file:",
  1385. "username": "",
  1386. "password": "",
  1387. "host": "",
  1388. "hostname": "",
  1389. "port": "",
  1390. "pathname": "/C:/foo/bar",
  1391. "search": "",
  1392. "hash": ""
  1393. },
  1394. {
  1395. "input": "//C|/foo/bar",
  1396. "base": "file:///tmp/mock/path",
  1397. "href": "file:///C:/foo/bar",
  1398. "protocol": "file:",
  1399. "username": "",
  1400. "password": "",
  1401. "host": "",
  1402. "hostname": "",
  1403. "port": "",
  1404. "pathname": "/C:/foo/bar",
  1405. "search": "",
  1406. "hash": ""
  1407. },
  1408. {
  1409. "input": "//server/file",
  1410. "base": "file:///tmp/mock/path",
  1411. "href": "file://server/file",
  1412. "protocol": "file:",
  1413. "username": "",
  1414. "password": "",
  1415. "host": "server",
  1416. "hostname": "server",
  1417. "port": "",
  1418. "pathname": "/file",
  1419. "search": "",
  1420. "hash": ""
  1421. },
  1422. {
  1423. "input": "\\\\server\\file",
  1424. "base": "file:///tmp/mock/path",
  1425. "href": "file://server/file",
  1426. "protocol": "file:",
  1427. "username": "",
  1428. "password": "",
  1429. "host": "server",
  1430. "hostname": "server",
  1431. "port": "",
  1432. "pathname": "/file",
  1433. "search": "",
  1434. "hash": ""
  1435. },
  1436. {
  1437. "input": "/\\server/file",
  1438. "base": "file:///tmp/mock/path",
  1439. "href": "file://server/file",
  1440. "protocol": "file:",
  1441. "username": "",
  1442. "password": "",
  1443. "host": "server",
  1444. "hostname": "server",
  1445. "port": "",
  1446. "pathname": "/file",
  1447. "search": "",
  1448. "hash": ""
  1449. },
  1450. {
  1451. "input": "file:///foo/bar.txt",
  1452. "base": "file:///tmp/mock/path",
  1453. "href": "file:///foo/bar.txt",
  1454. "protocol": "file:",
  1455. "username": "",
  1456. "password": "",
  1457. "host": "",
  1458. "hostname": "",
  1459. "port": "",
  1460. "pathname": "/foo/bar.txt",
  1461. "search": "",
  1462. "hash": ""
  1463. },
  1464. {
  1465. "input": "file:///home/me",
  1466. "base": "file:///tmp/mock/path",
  1467. "href": "file:///home/me",
  1468. "protocol": "file:",
  1469. "username": "",
  1470. "password": "",
  1471. "host": "",
  1472. "hostname": "",
  1473. "port": "",
  1474. "pathname": "/home/me",
  1475. "search": "",
  1476. "hash": ""
  1477. },
  1478. {
  1479. "input": "//",
  1480. "base": "file:///tmp/mock/path",
  1481. "href": "file:///",
  1482. "protocol": "file:",
  1483. "username": "",
  1484. "password": "",
  1485. "host": "",
  1486. "hostname": "",
  1487. "port": "",
  1488. "pathname": "/",
  1489. "search": "",
  1490. "hash": ""
  1491. },
  1492. {
  1493. "input": "///",
  1494. "base": "file:///tmp/mock/path",
  1495. "href": "file:///",
  1496. "protocol": "file:",
  1497. "username": "",
  1498. "password": "",
  1499. "host": "",
  1500. "hostname": "",
  1501. "port": "",
  1502. "pathname": "/",
  1503. "search": "",
  1504. "hash": ""
  1505. },
  1506. {
  1507. "input": "///test",
  1508. "base": "file:///tmp/mock/path",
  1509. "href": "file:///test",
  1510. "protocol": "file:",
  1511. "username": "",
  1512. "password": "",
  1513. "host": "",
  1514. "hostname": "",
  1515. "port": "",
  1516. "pathname": "/test",
  1517. "search": "",
  1518. "hash": ""
  1519. },
  1520. {
  1521. "input": "file://test",
  1522. "base": "file:///tmp/mock/path",
  1523. "href": "file://test/",
  1524. "protocol": "file:",
  1525. "username": "",
  1526. "password": "",
  1527. "host": "test",
  1528. "hostname": "test",
  1529. "port": "",
  1530. "pathname": "/",
  1531. "search": "",
  1532. "hash": ""
  1533. },
  1534. {
  1535. "input": "file://localhost",
  1536. "base": "file:///tmp/mock/path",
  1537. "href": "file:///",
  1538. "protocol": "file:",
  1539. "username": "",
  1540. "password": "",
  1541. "host": "",
  1542. "hostname": "",
  1543. "port": "",
  1544. "pathname": "/",
  1545. "search": "",
  1546. "hash": ""
  1547. },
  1548. {
  1549. "input": "file://localhost/",
  1550. "base": "file:///tmp/mock/path",
  1551. "href": "file:///",
  1552. "protocol": "file:",
  1553. "username": "",
  1554. "password": "",
  1555. "host": "",
  1556. "hostname": "",
  1557. "port": "",
  1558. "pathname": "/",
  1559. "search": "",
  1560. "hash": ""
  1561. },
  1562. {
  1563. "input": "file://localhost/test",
  1564. "base": "file:///tmp/mock/path",
  1565. "href": "file:///test",
  1566. "protocol": "file:",
  1567. "username": "",
  1568. "password": "",
  1569. "host": "",
  1570. "hostname": "",
  1571. "port": "",
  1572. "pathname": "/test",
  1573. "search": "",
  1574. "hash": ""
  1575. },
  1576. {
  1577. "input": "test",
  1578. "base": "file:///tmp/mock/path",
  1579. "href": "file:///tmp/mock/test",
  1580. "protocol": "file:",
  1581. "username": "",
  1582. "password": "",
  1583. "host": "",
  1584. "hostname": "",
  1585. "port": "",
  1586. "pathname": "/tmp/mock/test",
  1587. "search": "",
  1588. "hash": ""
  1589. },
  1590. {
  1591. "input": "file:test",
  1592. "base": "file:///tmp/mock/path",
  1593. "href": "file:///tmp/mock/test",
  1594. "protocol": "file:",
  1595. "username": "",
  1596. "password": "",
  1597. "host": "",
  1598. "hostname": "",
  1599. "port": "",
  1600. "pathname": "/tmp/mock/test",
  1601. "search": "",
  1602. "hash": ""
  1603. },
  1604. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
  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",
  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/.",
  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/./",
  1652. "base": "about:blank",
  1653. "href": "http://example.com/foo/",
  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/",
  1662. "search": "",
  1663. "hash": ""
  1664. },
  1665. {
  1666. "input": "http://example.com/foo/bar/..",
  1667. "base": "about:blank",
  1668. "href": "http://example.com/foo/",
  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/",
  1677. "search": "",
  1678. "hash": ""
  1679. },
  1680. {
  1681. "input": "http://example.com/foo/bar/../",
  1682. "base": "about:blank",
  1683. "href": "http://example.com/foo/",
  1684. "origin": "http://example.com",
  1685. "protocol": "http:",
  1686. "username": "",
  1687. "password": "",
  1688. "host": "example.com",
  1689. "hostname": "example.com",
  1690. "port": "",
  1691. "pathname": "/foo/",
  1692. "search": "",
  1693. "hash": ""
  1694. },
  1695. {
  1696. "input": "http://example.com/foo/..bar",
  1697. "base": "about:blank",
  1698. "href": "http://example.com/foo/..bar",
  1699. "origin": "http://example.com",
  1700. "protocol": "http:",
  1701. "username": "",
  1702. "password": "",
  1703. "host": "example.com",
  1704. "hostname": "example.com",
  1705. "port": "",
  1706. "pathname": "/foo/..bar",
  1707. "search": "",
  1708. "hash": ""
  1709. },
  1710. {
  1711. "input": "http://example.com/foo/bar/../ton",
  1712. "base": "about:blank",
  1713. "href": "http://example.com/foo/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": "/foo/ton",
  1722. "search": "",
  1723. "hash": ""
  1724. },
  1725. {
  1726. "input": "http://example.com/foo/bar/../ton/../../a",
  1727. "base": "about:blank",
  1728. "href": "http://example.com/a",
  1729. "origin": "http://example.com",
  1730. "protocol": "http:",
  1731. "username": "",
  1732. "password": "",
  1733. "host": "example.com",
  1734. "hostname": "example.com",
  1735. "port": "",
  1736. "pathname": "/a",
  1737. "search": "",
  1738. "hash": ""
  1739. },
  1740. {
  1741. "input": "http://example.com/foo/../../..",
  1742. "base": "about:blank",
  1743. "href": "http://example.com/",
  1744. "origin": "http://example.com",
  1745. "protocol": "http:",
  1746. "username": "",
  1747. "password": "",
  1748. "host": "example.com",
  1749. "hostname": "example.com",
  1750. "port": "",
  1751. "pathname": "/",
  1752. "search": "",
  1753. "hash": ""
  1754. },
  1755. {
  1756. "input": "http://example.com/foo/../../../ton",
  1757. "base": "about:blank",
  1758. "href": "http://example.com/ton",
  1759. "origin": "http://example.com",
  1760. "protocol": "http:",
  1761. "username": "",
  1762. "password": "",
  1763. "host": "example.com",
  1764. "hostname": "example.com",
  1765. "port": "",
  1766. "pathname": "/ton",
  1767. "search": "",
  1768. "hash": ""
  1769. },
  1770. {
  1771. "input": "http://example.com/foo/%2e",
  1772. "base": "about:blank",
  1773. "href": "http://example.com/foo/",
  1774. "origin": "http://example.com",
  1775. "protocol": "http:",
  1776. "username": "",
  1777. "password": "",
  1778. "host": "example.com",
  1779. "hostname": "example.com",
  1780. "port": "",
  1781. "pathname": "/foo/",
  1782. "search": "",
  1783. "hash": ""
  1784. },
  1785. {
  1786. "input": "http://example.com/foo/%2e%2",
  1787. "base": "about:blank",
  1788. "href": "http://example.com/foo/.%2",
  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/.%2",
  1797. "search": "",
  1798. "hash": ""
  1799. },
  1800. {
  1801. "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
  1802. "base": "about:blank",
  1803. "href": "http://example.com/..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": "/..bar",
  1812. "search": "",
  1813. "hash": ""
  1814. },
  1815. {
  1816. "input": "http://example.com////../..",
  1817. "base": "about:blank",
  1818. "href": "http://example.com//",
  1819. "origin": "http://example.com",
  1820. "protocol": "http:",
  1821. "username": "",
  1822. "password": "",
  1823. "host": "example.com",
  1824. "hostname": "example.com",
  1825. "port": "",
  1826. "pathname": "//",
  1827. "search": "",
  1828. "hash": ""
  1829. },
  1830. {
  1831. "input": "http://example.com/foo/bar//../..",
  1832. "base": "about:blank",
  1833. "href": "http://example.com/foo/",
  1834. "origin": "http://example.com",
  1835. "protocol": "http:",
  1836. "username": "",
  1837. "password": "",
  1838. "host": "example.com",
  1839. "hostname": "example.com",
  1840. "port": "",
  1841. "pathname": "/foo/",
  1842. "search": "",
  1843. "hash": ""
  1844. },
  1845. {
  1846. "input": "http://example.com/foo/bar//..",
  1847. "base": "about:blank",
  1848. "href": "http://example.com/foo/bar/",
  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/bar/",
  1857. "search": "",
  1858. "hash": ""
  1859. },
  1860. {
  1861. "input": "http://example.com/foo",
  1862. "base": "about:blank",
  1863. "href": "http://example.com/foo",
  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",
  1872. "search": "",
  1873. "hash": ""
  1874. },
  1875. {
  1876. "input": "http://example.com/%20foo",
  1877. "base": "about:blank",
  1878. "href": "http://example.com/%20foo",
  1879. "origin": "http://example.com",
  1880. "protocol": "http:",
  1881. "username": "",
  1882. "password": "",
  1883. "host": "example.com",
  1884. "hostname": "example.com",
  1885. "port": "",
  1886. "pathname": "/%20foo",
  1887. "search": "",
  1888. "hash": ""
  1889. },
  1890. {
  1891. "input": "http://example.com/foo%",
  1892. "base": "about:blank",
  1893. "href": "http://example.com/foo%",
  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%",
  1902. "search": "",
  1903. "hash": ""
  1904. },
  1905. {
  1906. "input": "http://example.com/foo%2",
  1907. "base": "about:blank",
  1908. "href": "http://example.com/foo%2",
  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%2",
  1917. "search": "",
  1918. "hash": ""
  1919. },
  1920. {
  1921. "input": "http://example.com/foo%2zbar",
  1922. "base": "about:blank",
  1923. "href": "http://example.com/foo%2zbar",
  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%2zbar",
  1932. "search": "",
  1933. "hash": ""
  1934. },
  1935. {
  1936. "input": "http://example.com/foo%2©zbar",
  1937. "base": "about:blank",
  1938. "href": "http://example.com/foo%2%C3%82%C2%A9zbar",
  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%2%C3%82%C2%A9zbar",
  1947. "search": "",
  1948. "hash": ""
  1949. },
  1950. {
  1951. "input": "http://example.com/foo%41%7a",
  1952. "base": "about:blank",
  1953. "href": "http://example.com/foo%41%7a",
  1954. "origin": "http://example.com",
  1955. "protocol": "http:",
  1956. "username": "",
  1957. "password": "",
  1958. "host": "example.com",
  1959. "hostname": "example.com",
  1960. "port": "",
  1961. "pathname": "/foo%41%7a",
  1962. "search": "",
  1963. "hash": ""
  1964. },
  1965. {
  1966. "input": "http://example.com/foo\t\u0091%91",
  1967. "base": "about:blank",
  1968. "href": "http://example.com/foo%C2%91%91",
  1969. "origin": "http://example.com",
  1970. "protocol": "http:",
  1971. "username": "",
  1972. "password": "",
  1973. "host": "example.com",
  1974. "hostname": "example.com",
  1975. "port": "",
  1976. "pathname": "/foo%C2%91%91",
  1977. "search": "",
  1978. "hash": ""
  1979. },
  1980. {
  1981. "input": "http://example.com/foo%00%51",
  1982. "base": "about:blank",
  1983. "href": "http://example.com/foo%00%51",
  1984. "origin": "http://example.com",
  1985. "protocol": "http:",
  1986. "username": "",
  1987. "password": "",
  1988. "host": "example.com",
  1989. "hostname": "example.com",
  1990. "port": "",
  1991. "pathname": "/foo%00%51",
  1992. "search": "",
  1993. "hash": ""
  1994. },
  1995. {
  1996. "input": "http://example.com/(%28:%3A%29)",
  1997. "base": "about:blank",
  1998. "href": "http://example.com/(%28:%3A%29)",
  1999. "origin": "http://example.com",
  2000. "protocol": "http:",
  2001. "username": "",
  2002. "password": "",
  2003. "host": "example.com",
  2004. "hostname": "example.com",
  2005. "port": "",
  2006. "pathname": "/(%28:%3A%29)",
  2007. "search": "",
  2008. "hash": ""
  2009. },
  2010. {
  2011. "input": "http://example.com/%3A%3a%3C%3c",
  2012. "base": "about:blank",
  2013. "href": "http://example.com/%3A%3a%3C%3c",
  2014. "origin": "http://example.com",
  2015. "protocol": "http:",
  2016. "username": "",
  2017. "password": "",
  2018. "host": "example.com",
  2019. "hostname": "example.com",
  2020. "port": "",
  2021. "pathname": "/%3A%3a%3C%3c",
  2022. "search": "",
  2023. "hash": ""
  2024. },
  2025. {
  2026. "input": "http://example.com/foo\tbar",
  2027. "base": "about:blank",
  2028. "href": "http://example.com/foobar",
  2029. "origin": "http://example.com",
  2030. "protocol": "http:",
  2031. "username": "",
  2032. "password": "",
  2033. "host": "example.com",
  2034. "hostname": "example.com",
  2035. "port": "",
  2036. "pathname": "/foobar",
  2037. "search": "",
  2038. "hash": ""
  2039. },
  2040. {
  2041. "input": "http://example.com\\\\foo\\\\bar",
  2042. "base": "about:blank",
  2043. "href": "http://example.com//foo//bar",
  2044. "origin": "http://example.com",
  2045. "protocol": "http:",
  2046. "username": "",
  2047. "password": "",
  2048. "host": "example.com",
  2049. "hostname": "example.com",
  2050. "port": "",
  2051. "pathname": "//foo//bar",
  2052. "search": "",
  2053. "hash": ""
  2054. },
  2055. {
  2056. "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2057. "base": "about:blank",
  2058. "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2059. "origin": "http://example.com",
  2060. "protocol": "http:",
  2061. "username": "",
  2062. "password": "",
  2063. "host": "example.com",
  2064. "hostname": "example.com",
  2065. "port": "",
  2066. "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2067. "search": "",
  2068. "hash": ""
  2069. },
  2070. {
  2071. "input": "http://example.com/@asdf%40",
  2072. "base": "about:blank",
  2073. "href": "http://example.com/@asdf%40",
  2074. "origin": "http://example.com",
  2075. "protocol": "http:",
  2076. "username": "",
  2077. "password": "",
  2078. "host": "example.com",
  2079. "hostname": "example.com",
  2080. "port": "",
  2081. "pathname": "/@asdf%40",
  2082. "search": "",
  2083. "hash": ""
  2084. },
  2085. {
  2086. "input": "http://example.com/你好你好",
  2087. "base": "about:blank",
  2088. "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2089. "origin": "http://example.com",
  2090. "protocol": "http:",
  2091. "username": "",
  2092. "password": "",
  2093. "host": "example.com",
  2094. "hostname": "example.com",
  2095. "port": "",
  2096. "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2097. "search": "",
  2098. "hash": ""
  2099. },
  2100. {
  2101. "input": "http://example.com/‥/foo",
  2102. "base": "about:blank",
  2103. "href": "http://example.com/%E2%80%A5/foo",
  2104. "origin": "http://example.com",
  2105. "protocol": "http:",
  2106. "username": "",
  2107. "password": "",
  2108. "host": "example.com",
  2109. "hostname": "example.com",
  2110. "port": "",
  2111. "pathname": "/%E2%80%A5/foo",
  2112. "search": "",
  2113. "hash": ""
  2114. },
  2115. {
  2116. "input": "http://example.com//foo",
  2117. "base": "about:blank",
  2118. "href": "http://example.com/%EF%BB%BF/foo",
  2119. "origin": "http://example.com",
  2120. "protocol": "http:",
  2121. "username": "",
  2122. "password": "",
  2123. "host": "example.com",
  2124. "hostname": "example.com",
  2125. "port": "",
  2126. "pathname": "/%EF%BB%BF/foo",
  2127. "search": "",
  2128. "hash": ""
  2129. },
  2130. {
  2131. "input": "http://example.com/‮/foo/‭/bar",
  2132. "base": "about:blank",
  2133. "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar",
  2134. "origin": "http://example.com",
  2135. "protocol": "http:",
  2136. "username": "",
  2137. "password": "",
  2138. "host": "example.com",
  2139. "hostname": "example.com",
  2140. "port": "",
  2141. "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
  2142. "search": "",
  2143. "hash": ""
  2144. },
  2145. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js",
  2146. {
  2147. "input": "http://www.google.com/foo?bar=baz#",
  2148. "base": "about:blank",
  2149. "href": "http://www.google.com/foo?bar=baz#",
  2150. "origin": "http://www.google.com",
  2151. "protocol": "http:",
  2152. "username": "",
  2153. "password": "",
  2154. "host": "www.google.com",
  2155. "hostname": "www.google.com",
  2156. "port": "",
  2157. "pathname": "/foo",
  2158. "search": "?bar=baz",
  2159. "hash": ""
  2160. },
  2161. {
  2162. "input": "http://www.google.com/foo?bar=baz# »",
  2163. "base": "about:blank",
  2164. "href": "http://www.google.com/foo?bar=baz# %C2%BB",
  2165. "origin": "http://www.google.com",
  2166. "protocol": "http:",
  2167. "username": "",
  2168. "password": "",
  2169. "host": "www.google.com",
  2170. "hostname": "www.google.com",
  2171. "port": "",
  2172. "pathname": "/foo",
  2173. "search": "?bar=baz",
  2174. "hash": "# %C2%BB"
  2175. },
  2176. {
  2177. "input": "data:test# »",
  2178. "base": "about:blank",
  2179. "href": "data:test# %C2%BB",
  2180. "origin": "null",
  2181. "protocol": "data:",
  2182. "username": "",
  2183. "password": "",
  2184. "host": "",
  2185. "hostname": "",
  2186. "port": "",
  2187. "pathname": "test",
  2188. "search": "",
  2189. "hash": "# %C2%BB"
  2190. },
  2191. {
  2192. "input": "http://[www.google.com]/",
  2193. "base": "about:blank",
  2194. "failure": true
  2195. },
  2196. {
  2197. "input": "http://www.google.com",
  2198. "base": "about:blank",
  2199. "href": "http://www.google.com/",
  2200. "origin": "http://www.google.com",
  2201. "protocol": "http:",
  2202. "username": "",
  2203. "password": "",
  2204. "host": "www.google.com",
  2205. "hostname": "www.google.com",
  2206. "port": "",
  2207. "pathname": "/",
  2208. "search": "",
  2209. "hash": ""
  2210. },
  2211. {
  2212. "input": "http://192.0x00A80001",
  2213. "base": "about:blank",
  2214. "href": "http://192.168.0.1/",
  2215. "origin": "http://192.168.0.1",
  2216. "protocol": "http:",
  2217. "username": "",
  2218. "password": "",
  2219. "host": "192.168.0.1",
  2220. "hostname": "192.168.0.1",
  2221. "port": "",
  2222. "pathname": "/",
  2223. "search": "",
  2224. "hash": ""
  2225. },
  2226. {
  2227. "input": "http://www/foo%2Ehtml",
  2228. "base": "about:blank",
  2229. "href": "http://www/foo.html",
  2230. "origin": "http://www",
  2231. "protocol": "http:",
  2232. "username": "",
  2233. "password": "",
  2234. "host": "www",
  2235. "hostname": "www",
  2236. "port": "",
  2237. "pathname": "/foo.html",
  2238. "search": "",
  2239. "hash": ""
  2240. },
  2241. {
  2242. "input": "http://www/foo/%2E/html",
  2243. "base": "about:blank",
  2244. "href": "http://www/foo/html",
  2245. "origin": "http://www",
  2246. "protocol": "http:",
  2247. "username": "",
  2248. "password": "",
  2249. "host": "www",
  2250. "hostname": "www",
  2251. "port": "",
  2252. "pathname": "/foo/html",
  2253. "search": "",
  2254. "hash": ""
  2255. },
  2256. {
  2257. "input": "http://user:pass@/",
  2258. "base": "about:blank",
  2259. "failure": true
  2260. },
  2261. {
  2262. "input": "http://%25DOMAIN:foobar@foodomain.com/",
  2263. "base": "about:blank",
  2264. "href": "http://%25DOMAIN:foobar@foodomain.com/",
  2265. "origin": "http://foodomain.com",
  2266. "protocol": "http:",
  2267. "username": "%25DOMAIN",
  2268. "password": "foobar",
  2269. "host": "foodomain.com",
  2270. "hostname": "foodomain.com",
  2271. "port": "",
  2272. "pathname": "/",
  2273. "search": "",
  2274. "hash": ""
  2275. },
  2276. {
  2277. "input": "http:\\\\www.google.com\\foo",
  2278. "base": "about:blank",
  2279. "href": "http://www.google.com/foo",
  2280. "origin": "http://www.google.com",
  2281. "protocol": "http:",
  2282. "username": "",
  2283. "password": "",
  2284. "host": "www.google.com",
  2285. "hostname": "www.google.com",
  2286. "port": "",
  2287. "pathname": "/foo",
  2288. "search": "",
  2289. "hash": ""
  2290. },
  2291. {
  2292. "input": "http://foo:80/",
  2293. "base": "about:blank",
  2294. "href": "http://foo/",
  2295. "origin": "http://foo",
  2296. "protocol": "http:",
  2297. "username": "",
  2298. "password": "",
  2299. "host": "foo",
  2300. "hostname": "foo",
  2301. "port": "",
  2302. "pathname": "/",
  2303. "search": "",
  2304. "hash": ""
  2305. },
  2306. {
  2307. "input": "http://foo:81/",
  2308. "base": "about:blank",
  2309. "href": "http://foo:81/",
  2310. "origin": "http://foo:81",
  2311. "protocol": "http:",
  2312. "username": "",
  2313. "password": "",
  2314. "host": "foo:81",
  2315. "hostname": "foo",
  2316. "port": "81",
  2317. "pathname": "/",
  2318. "search": "",
  2319. "hash": ""
  2320. },
  2321. {
  2322. "input": "httpa://foo:80/",
  2323. "base": "about:blank",
  2324. "href": "httpa://foo:80/",
  2325. "origin": "null",
  2326. "protocol": "httpa:",
  2327. "username": "",
  2328. "password": "",
  2329. "host": "foo:80",
  2330. "hostname": "foo",
  2331. "port": "80",
  2332. "pathname": "/",
  2333. "search": "",
  2334. "hash": ""
  2335. },
  2336. {
  2337. "input": "http://foo:-80/",
  2338. "base": "about:blank",
  2339. "failure": true
  2340. },
  2341. {
  2342. "input": "https://foo:443/",
  2343. "base": "about:blank",
  2344. "href": "https://foo/",
  2345. "origin": "https://foo",
  2346. "protocol": "https:",
  2347. "username": "",
  2348. "password": "",
  2349. "host": "foo",
  2350. "hostname": "foo",
  2351. "port": "",
  2352. "pathname": "/",
  2353. "search": "",
  2354. "hash": ""
  2355. },
  2356. {
  2357. "input": "https://foo:80/",
  2358. "base": "about:blank",
  2359. "href": "https://foo:80/",
  2360. "origin": "https://foo:80",
  2361. "protocol": "https:",
  2362. "username": "",
  2363. "password": "",
  2364. "host": "foo:80",
  2365. "hostname": "foo",
  2366. "port": "80",
  2367. "pathname": "/",
  2368. "search": "",
  2369. "hash": ""
  2370. },
  2371. {
  2372. "input": "ftp://foo:21/",
  2373. "base": "about:blank",
  2374. "href": "ftp://foo/",
  2375. "origin": "ftp://foo",
  2376. "protocol": "ftp:",
  2377. "username": "",
  2378. "password": "",
  2379. "host": "foo",
  2380. "hostname": "foo",
  2381. "port": "",
  2382. "pathname": "/",
  2383. "search": "",
  2384. "hash": ""
  2385. },
  2386. {
  2387. "input": "ftp://foo:80/",
  2388. "base": "about:blank",
  2389. "href": "ftp://foo:80/",
  2390. "origin": "ftp://foo:80",
  2391. "protocol": "ftp:",
  2392. "username": "",
  2393. "password": "",
  2394. "host": "foo:80",
  2395. "hostname": "foo",
  2396. "port": "80",
  2397. "pathname": "/",
  2398. "search": "",
  2399. "hash": ""
  2400. },
  2401. {
  2402. "input": "gopher://foo:70/",
  2403. "base": "about:blank",
  2404. "href": "gopher://foo/",
  2405. "origin": "gopher://foo",
  2406. "protocol": "gopher:",
  2407. "username": "",
  2408. "password": "",
  2409. "host": "foo",
  2410. "hostname": "foo",
  2411. "port": "",
  2412. "pathname": "/",
  2413. "search": "",
  2414. "hash": ""
  2415. },
  2416. {
  2417. "input": "gopher://foo:443/",
  2418. "base": "about:blank",
  2419. "href": "gopher://foo:443/",
  2420. "origin": "gopher://foo:443",
  2421. "protocol": "gopher:",
  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:80/",
  2433. "base": "about:blank",
  2434. "href": "ws://foo/",
  2435. "origin": "ws://foo",
  2436. "protocol": "ws:",
  2437. "username": "",
  2438. "password": "",
  2439. "host": "foo",
  2440. "hostname": "foo",
  2441. "port": "",
  2442. "pathname": "/",
  2443. "search": "",
  2444. "hash": ""
  2445. },
  2446. {
  2447. "input": "ws://foo:81/",
  2448. "base": "about:blank",
  2449. "href": "ws://foo:81/",
  2450. "origin": "ws://foo:81",
  2451. "protocol": "ws:",
  2452. "username": "",
  2453. "password": "",
  2454. "host": "foo:81",
  2455. "hostname": "foo",
  2456. "port": "81",
  2457. "pathname": "/",
  2458. "search": "",
  2459. "hash": ""
  2460. },
  2461. {
  2462. "input": "ws://foo:443/",
  2463. "base": "about:blank",
  2464. "href": "ws://foo:443/",
  2465. "origin": "ws://foo:443",
  2466. "protocol": "ws:",
  2467. "username": "",
  2468. "password": "",
  2469. "host": "foo:443",
  2470. "hostname": "foo",
  2471. "port": "443",
  2472. "pathname": "/",
  2473. "search": "",
  2474. "hash": ""
  2475. },
  2476. {
  2477. "input": "ws://foo:815/",
  2478. "base": "about:blank",
  2479. "href": "ws://foo:815/",
  2480. "origin": "ws://foo:815",
  2481. "protocol": "ws:",
  2482. "username": "",
  2483. "password": "",
  2484. "host": "foo:815",
  2485. "hostname": "foo",
  2486. "port": "815",
  2487. "pathname": "/",
  2488. "search": "",
  2489. "hash": ""
  2490. },
  2491. {
  2492. "input": "wss://foo:80/",
  2493. "base": "about:blank",
  2494. "href": "wss://foo:80/",
  2495. "origin": "wss://foo:80",
  2496. "protocol": "wss:",
  2497. "username": "",
  2498. "password": "",
  2499. "host": "foo:80",
  2500. "hostname": "foo",
  2501. "port": "80",
  2502. "pathname": "/",
  2503. "search": "",
  2504. "hash": ""
  2505. },
  2506. {
  2507. "input": "wss://foo:81/",
  2508. "base": "about:blank",
  2509. "href": "wss://foo:81/",
  2510. "origin": "wss://foo:81",
  2511. "protocol": "wss:",
  2512. "username": "",
  2513. "password": "",
  2514. "host": "foo:81",
  2515. "hostname": "foo",
  2516. "port": "81",
  2517. "pathname": "/",
  2518. "search": "",
  2519. "hash": ""
  2520. },
  2521. {
  2522. "input": "wss://foo:443/",
  2523. "base": "about:blank",
  2524. "href": "wss://foo/",
  2525. "origin": "wss://foo",
  2526. "protocol": "wss:",
  2527. "username": "",
  2528. "password": "",
  2529. "host": "foo",
  2530. "hostname": "foo",
  2531. "port": "",
  2532. "pathname": "/",
  2533. "search": "",
  2534. "hash": ""
  2535. },
  2536. {
  2537. "input": "wss://foo:815/",
  2538. "base": "about:blank",
  2539. "href": "wss://foo:815/",
  2540. "origin": "wss://foo:815",
  2541. "protocol": "wss:",
  2542. "username": "",
  2543. "password": "",
  2544. "host": "foo:815",
  2545. "hostname": "foo",
  2546. "port": "815",
  2547. "pathname": "/",
  2548. "search": "",
  2549. "hash": ""
  2550. },
  2551. {
  2552. "input": "http:/example.com/",
  2553. "base": "about:blank",
  2554. "href": "http://example.com/",
  2555. "origin": "http://example.com",
  2556. "protocol": "http:",
  2557. "username": "",
  2558. "password": "",
  2559. "host": "example.com",
  2560. "hostname": "example.com",
  2561. "port": "",
  2562. "pathname": "/",
  2563. "search": "",
  2564. "hash": ""
  2565. },
  2566. {
  2567. "input": "ftp:/example.com/",
  2568. "base": "about:blank",
  2569. "href": "ftp://example.com/",
  2570. "origin": "ftp://example.com",
  2571. "protocol": "ftp:",
  2572. "username": "",
  2573. "password": "",
  2574. "host": "example.com",
  2575. "hostname": "example.com",
  2576. "port": "",
  2577. "pathname": "/",
  2578. "search": "",
  2579. "hash": ""
  2580. },
  2581. {
  2582. "input": "https:/example.com/",
  2583. "base": "about:blank",
  2584. "href": "https://example.com/",
  2585. "origin": "https://example.com",
  2586. "protocol": "https:",
  2587. "username": "",
  2588. "password": "",
  2589. "host": "example.com",
  2590. "hostname": "example.com",
  2591. "port": "",
  2592. "pathname": "/",
  2593. "search": "",
  2594. "hash": ""
  2595. },
  2596. {
  2597. "input": "madeupscheme:/example.com/",
  2598. "base": "about:blank",
  2599. "href": "madeupscheme:/example.com/",
  2600. "origin": "null",
  2601. "protocol": "madeupscheme:",
  2602. "username": "",
  2603. "password": "",
  2604. "host": "",
  2605. "hostname": "",
  2606. "port": "",
  2607. "pathname": "/example.com/",
  2608. "search": "",
  2609. "hash": ""
  2610. },
  2611. {
  2612. "input": "file:/example.com/",
  2613. "base": "about:blank",
  2614. "href": "file:///example.com/",
  2615. "protocol": "file:",
  2616. "username": "",
  2617. "password": "",
  2618. "host": "",
  2619. "hostname": "",
  2620. "port": "",
  2621. "pathname": "/example.com/",
  2622. "search": "",
  2623. "hash": ""
  2624. },
  2625. {
  2626. "input": "ftps:/example.com/",
  2627. "base": "about:blank",
  2628. "href": "ftps:/example.com/",
  2629. "origin": "null",
  2630. "protocol": "ftps:",
  2631. "username": "",
  2632. "password": "",
  2633. "host": "",
  2634. "hostname": "",
  2635. "port": "",
  2636. "pathname": "/example.com/",
  2637. "search": "",
  2638. "hash": ""
  2639. },
  2640. {
  2641. "input": "gopher:/example.com/",
  2642. "base": "about:blank",
  2643. "href": "gopher://example.com/",
  2644. "origin": "gopher://example.com",
  2645. "protocol": "gopher:",
  2646. "username": "",
  2647. "password": "",
  2648. "host": "example.com",
  2649. "hostname": "example.com",
  2650. "port": "",
  2651. "pathname": "/",
  2652. "search": "",
  2653. "hash": ""
  2654. },
  2655. {
  2656. "input": "ws:/example.com/",
  2657. "base": "about:blank",
  2658. "href": "ws://example.com/",
  2659. "origin": "ws://example.com",
  2660. "protocol": "ws:",
  2661. "username": "",
  2662. "password": "",
  2663. "host": "example.com",
  2664. "hostname": "example.com",
  2665. "port": "",
  2666. "pathname": "/",
  2667. "search": "",
  2668. "hash": ""
  2669. },
  2670. {
  2671. "input": "wss:/example.com/",
  2672. "base": "about:blank",
  2673. "href": "wss://example.com/",
  2674. "origin": "wss://example.com",
  2675. "protocol": "wss:",
  2676. "username": "",
  2677. "password": "",
  2678. "host": "example.com",
  2679. "hostname": "example.com",
  2680. "port": "",
  2681. "pathname": "/",
  2682. "search": "",
  2683. "hash": ""
  2684. },
  2685. {
  2686. "input": "data:/example.com/",
  2687. "base": "about:blank",
  2688. "href": "data:/example.com/",
  2689. "origin": "null",
  2690. "protocol": "data:",
  2691. "username": "",
  2692. "password": "",
  2693. "host": "",
  2694. "hostname": "",
  2695. "port": "",
  2696. "pathname": "/example.com/",
  2697. "search": "",
  2698. "hash": ""
  2699. },
  2700. {
  2701. "input": "javascript:/example.com/",
  2702. "base": "about:blank",
  2703. "href": "javascript:/example.com/",
  2704. "origin": "null",
  2705. "protocol": "javascript:",
  2706. "username": "",
  2707. "password": "",
  2708. "host": "",
  2709. "hostname": "",
  2710. "port": "",
  2711. "pathname": "/example.com/",
  2712. "search": "",
  2713. "hash": ""
  2714. },
  2715. {
  2716. "input": "mailto:/example.com/",
  2717. "base": "about:blank",
  2718. "href": "mailto:/example.com/",
  2719. "origin": "null",
  2720. "protocol": "mailto:",
  2721. "username": "",
  2722. "password": "",
  2723. "host": "",
  2724. "hostname": "",
  2725. "port": "",
  2726. "pathname": "/example.com/",
  2727. "search": "",
  2728. "hash": ""
  2729. },
  2730. {
  2731. "input": "http:example.com/",
  2732. "base": "about:blank",
  2733. "href": "http://example.com/",
  2734. "origin": "http://example.com",
  2735. "protocol": "http:",
  2736. "username": "",
  2737. "password": "",
  2738. "host": "example.com",
  2739. "hostname": "example.com",
  2740. "port": "",
  2741. "pathname": "/",
  2742. "search": "",
  2743. "hash": ""
  2744. },
  2745. {
  2746. "input": "ftp:example.com/",
  2747. "base": "about:blank",
  2748. "href": "ftp://example.com/",
  2749. "origin": "ftp://example.com",
  2750. "protocol": "ftp:",
  2751. "username": "",
  2752. "password": "",
  2753. "host": "example.com",
  2754. "hostname": "example.com",
  2755. "port": "",
  2756. "pathname": "/",
  2757. "search": "",
  2758. "hash": ""
  2759. },
  2760. {
  2761. "input": "https:example.com/",
  2762. "base": "about:blank",
  2763. "href": "https://example.com/",
  2764. "origin": "https://example.com",
  2765. "protocol": "https:",
  2766. "username": "",
  2767. "password": "",
  2768. "host": "example.com",
  2769. "hostname": "example.com",
  2770. "port": "",
  2771. "pathname": "/",
  2772. "search": "",
  2773. "hash": ""
  2774. },
  2775. {
  2776. "input": "madeupscheme:example.com/",
  2777. "base": "about:blank",
  2778. "href": "madeupscheme:example.com/",
  2779. "origin": "null",
  2780. "protocol": "madeupscheme:",
  2781. "username": "",
  2782. "password": "",
  2783. "host": "",
  2784. "hostname": "",
  2785. "port": "",
  2786. "pathname": "example.com/",
  2787. "search": "",
  2788. "hash": ""
  2789. },
  2790. {
  2791. "input": "ftps:example.com/",
  2792. "base": "about:blank",
  2793. "href": "ftps:example.com/",
  2794. "origin": "null",
  2795. "protocol": "ftps:",
  2796. "username": "",
  2797. "password": "",
  2798. "host": "",
  2799. "hostname": "",
  2800. "port": "",
  2801. "pathname": "example.com/",
  2802. "search": "",
  2803. "hash": ""
  2804. },
  2805. {
  2806. "input": "gopher:example.com/",
  2807. "base": "about:blank",
  2808. "href": "gopher://example.com/",
  2809. "origin": "gopher://example.com",
  2810. "protocol": "gopher:",
  2811. "username": "",
  2812. "password": "",
  2813. "host": "example.com",
  2814. "hostname": "example.com",
  2815. "port": "",
  2816. "pathname": "/",
  2817. "search": "",
  2818. "hash": ""
  2819. },
  2820. {
  2821. "input": "ws:example.com/",
  2822. "base": "about:blank",
  2823. "href": "ws://example.com/",
  2824. "origin": "ws://example.com",
  2825. "protocol": "ws:",
  2826. "username": "",
  2827. "password": "",
  2828. "host": "example.com",
  2829. "hostname": "example.com",
  2830. "port": "",
  2831. "pathname": "/",
  2832. "search": "",
  2833. "hash": ""
  2834. },
  2835. {
  2836. "input": "wss:example.com/",
  2837. "base": "about:blank",
  2838. "href": "wss://example.com/",
  2839. "origin": "wss://example.com",
  2840. "protocol": "wss:",
  2841. "username": "",
  2842. "password": "",
  2843. "host": "example.com",
  2844. "hostname": "example.com",
  2845. "port": "",
  2846. "pathname": "/",
  2847. "search": "",
  2848. "hash": ""
  2849. },
  2850. {
  2851. "input": "data:example.com/",
  2852. "base": "about:blank",
  2853. "href": "data:example.com/",
  2854. "origin": "null",
  2855. "protocol": "data:",
  2856. "username": "",
  2857. "password": "",
  2858. "host": "",
  2859. "hostname": "",
  2860. "port": "",
  2861. "pathname": "example.com/",
  2862. "search": "",
  2863. "hash": ""
  2864. },
  2865. {
  2866. "input": "javascript:example.com/",
  2867. "base": "about:blank",
  2868. "href": "javascript:example.com/",
  2869. "origin": "null",
  2870. "protocol": "javascript:",
  2871. "username": "",
  2872. "password": "",
  2873. "host": "",
  2874. "hostname": "",
  2875. "port": "",
  2876. "pathname": "example.com/",
  2877. "search": "",
  2878. "hash": ""
  2879. },
  2880. {
  2881. "input": "mailto:example.com/",
  2882. "base": "about:blank",
  2883. "href": "mailto:example.com/",
  2884. "origin": "null",
  2885. "protocol": "mailto:",
  2886. "username": "",
  2887. "password": "",
  2888. "host": "",
  2889. "hostname": "",
  2890. "port": "",
  2891. "pathname": "example.com/",
  2892. "search": "",
  2893. "hash": ""
  2894. },
  2895. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html",
  2896. {
  2897. "input": "http:@www.example.com",
  2898. "base": "about:blank",
  2899. "href": "http://www.example.com/",
  2900. "origin": "http://www.example.com",
  2901. "protocol": "http:",
  2902. "username": "",
  2903. "password": "",
  2904. "host": "www.example.com",
  2905. "hostname": "www.example.com",
  2906. "port": "",
  2907. "pathname": "/",
  2908. "search": "",
  2909. "hash": ""
  2910. },
  2911. {
  2912. "input": "http:/@www.example.com",
  2913. "base": "about:blank",
  2914. "href": "http://www.example.com/",
  2915. "origin": "http://www.example.com",
  2916. "protocol": "http:",
  2917. "username": "",
  2918. "password": "",
  2919. "host": "www.example.com",
  2920. "hostname": "www.example.com",
  2921. "port": "",
  2922. "pathname": "/",
  2923. "search": "",
  2924. "hash": ""
  2925. },
  2926. {
  2927. "input": "http://@www.example.com",
  2928. "base": "about:blank",
  2929. "href": "http://www.example.com/",
  2930. "origin": "http://www.example.com",
  2931. "protocol": "http:",
  2932. "username": "",
  2933. "password": "",
  2934. "host": "www.example.com",
  2935. "hostname": "www.example.com",
  2936. "port": "",
  2937. "pathname": "/",
  2938. "search": "",
  2939. "hash": ""
  2940. },
  2941. {
  2942. "input": "http:a:b@www.example.com",
  2943. "base": "about:blank",
  2944. "href": "http://a:b@www.example.com/",
  2945. "origin": "http://www.example.com",
  2946. "protocol": "http:",
  2947. "username": "a",
  2948. "password": "b",
  2949. "host": "www.example.com",
  2950. "hostname": "www.example.com",
  2951. "port": "",
  2952. "pathname": "/",
  2953. "search": "",
  2954. "hash": ""
  2955. },
  2956. {
  2957. "input": "http:/a:b@www.example.com",
  2958. "base": "about:blank",
  2959. "href": "http://a:b@www.example.com/",
  2960. "origin": "http://www.example.com",
  2961. "protocol": "http:",
  2962. "username": "a",
  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://a:b@www.example.com",
  2973. "base": "about:blank",
  2974. "href": "http://a:b@www.example.com/",
  2975. "origin": "http://www.example.com",
  2976. "protocol": "http:",
  2977. "username": "a",
  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://@pple.com",
  2988. "base": "about:blank",
  2989. "href": "http://pple.com/",
  2990. "origin": "http://pple.com",
  2991. "protocol": "http:",
  2992. "username": "",
  2993. "password": "",
  2994. "host": "pple.com",
  2995. "hostname": "pple.com",
  2996. "port": "",
  2997. "pathname": "/",
  2998. "search": "",
  2999. "hash": ""
  3000. },
  3001. {
  3002. "input": "http::b@www.example.com",
  3003. "base": "about:blank",
  3004. "href": "http://:b@www.example.com/",
  3005. "origin": "http://www.example.com",
  3006. "protocol": "http:",
  3007. "username": "",
  3008. "password": "b",
  3009. "host": "www.example.com",
  3010. "hostname": "www.example.com",
  3011. "port": "",
  3012. "pathname": "/",
  3013. "search": "",
  3014. "hash": ""
  3015. },
  3016. {
  3017. "input": "http:/:b@www.example.com",
  3018. "base": "about:blank",
  3019. "href": "http://:b@www.example.com/",
  3020. "origin": "http://www.example.com",
  3021. "protocol": "http:",
  3022. "username": "",
  3023. "password": "b",
  3024. "host": "www.example.com",
  3025. "hostname": "www.example.com",
  3026. "port": "",
  3027. "pathname": "/",
  3028. "search": "",
  3029. "hash": ""
  3030. },
  3031. {
  3032. "input": "http://:b@www.example.com",
  3033. "base": "about:blank",
  3034. "href": "http://:b@www.example.com/",
  3035. "origin": "http://www.example.com",
  3036. "protocol": "http:",
  3037. "username": "",
  3038. "password": "b",
  3039. "host": "www.example.com",
  3040. "hostname": "www.example.com",
  3041. "port": "",
  3042. "pathname": "/",
  3043. "search": "",
  3044. "hash": ""
  3045. },
  3046. {
  3047. "input": "http:/:@/www.example.com",
  3048. "base": "about:blank",
  3049. "failure": true
  3050. },
  3051. {
  3052. "input": "http://user@/www.example.com",
  3053. "base": "about:blank",
  3054. "failure": true
  3055. },
  3056. {
  3057. "input": "http:@/www.example.com",
  3058. "base": "about:blank",
  3059. "failure": true
  3060. },
  3061. {
  3062. "input": "http:/@/www.example.com",
  3063. "base": "about:blank",
  3064. "failure": true
  3065. },
  3066. {
  3067. "input": "http://@/www.example.com",
  3068. "base": "about:blank",
  3069. "failure": true
  3070. },
  3071. {
  3072. "input": "https:@/www.example.com",
  3073. "base": "about:blank",
  3074. "failure": true
  3075. },
  3076. {
  3077. "input": "http:a:b@/www.example.com",
  3078. "base": "about:blank",
  3079. "failure": true
  3080. },
  3081. {
  3082. "input": "http:/a:b@/www.example.com",
  3083. "base": "about:blank",
  3084. "failure": true
  3085. },
  3086. {
  3087. "input": "http://a:b@/www.example.com",
  3088. "base": "about:blank",
  3089. "failure": true
  3090. },
  3091. {
  3092. "input": "http::@/www.example.com",
  3093. "base": "about:blank",
  3094. "failure": true
  3095. },
  3096. {
  3097. "input": "http:a:@www.example.com",
  3098. "base": "about:blank",
  3099. "href": "http://a:@www.example.com/",
  3100. "origin": "http://www.example.com",
  3101. "protocol": "http:",
  3102. "username": "a",
  3103. "password": "",
  3104. "host": "www.example.com",
  3105. "hostname": "www.example.com",
  3106. "port": "",
  3107. "pathname": "/",
  3108. "search": "",
  3109. "hash": ""
  3110. },
  3111. {
  3112. "input": "http:/a:@www.example.com",
  3113. "base": "about:blank",
  3114. "href": "http://a:@www.example.com/",
  3115. "origin": "http://www.example.com",
  3116. "protocol": "http:",
  3117. "username": "a",
  3118. "password": "",
  3119. "host": "www.example.com",
  3120. "hostname": "www.example.com",
  3121. "port": "",
  3122. "pathname": "/",
  3123. "search": "",
  3124. "hash": ""
  3125. },
  3126. {
  3127. "input": "http://a:@www.example.com",
  3128. "base": "about:blank",
  3129. "href": "http://a:@www.example.com/",
  3130. "origin": "http://www.example.com",
  3131. "protocol": "http:",
  3132. "username": "a",
  3133. "password": "",
  3134. "host": "www.example.com",
  3135. "hostname": "www.example.com",
  3136. "port": "",
  3137. "pathname": "/",
  3138. "search": "",
  3139. "hash": ""
  3140. },
  3141. {
  3142. "input": "http://www.@pple.com",
  3143. "base": "about:blank",
  3144. "href": "http://www.@pple.com/",
  3145. "origin": "http://pple.com",
  3146. "protocol": "http:",
  3147. "username": "www.",
  3148. "password": "",
  3149. "host": "pple.com",
  3150. "hostname": "pple.com",
  3151. "port": "",
  3152. "pathname": "/",
  3153. "search": "",
  3154. "hash": ""
  3155. },
  3156. {
  3157. "input": "http:@:www.example.com",
  3158. "base": "about:blank",
  3159. "failure": true
  3160. },
  3161. {
  3162. "input": "http:/@:www.example.com",
  3163. "base": "about:blank",
  3164. "failure": true
  3165. },
  3166. {
  3167. "input": "http://@:www.example.com",
  3168. "base": "about:blank",
  3169. "failure": true
  3170. },
  3171. {
  3172. "input": "http://:@www.example.com",
  3173. "base": "about:blank",
  3174. "href": "http://:@www.example.com/",
  3175. "origin": "http://www.example.com",
  3176. "protocol": "http:",
  3177. "username": "",
  3178. "password": "",
  3179. "host": "www.example.com",
  3180. "hostname": "www.example.com",
  3181. "port": "",
  3182. "pathname": "/",
  3183. "search": "",
  3184. "hash": ""
  3185. },
  3186. "# Others",
  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": ".",
  3219. "base": "http://www.example.com/test",
  3220. "href": "http://www.example.com/",
  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": "/",
  3229. "search": "",
  3230. "hash": ""
  3231. },
  3232. {
  3233. "input": "..",
  3234. "base": "http://www.example.com/test",
  3235. "href": "http://www.example.com/",
  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": "/",
  3244. "search": "",
  3245. "hash": ""
  3246. },
  3247. {
  3248. "input": "test.txt",
  3249. "base": "http://www.example.com/test",
  3250. "href": "http://www.example.com/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": "/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/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": "/test.txt",
  3289. "search": "",
  3290. "hash": ""
  3291. },
  3292. {
  3293. "input": "../aaa/test.txt",
  3294. "base": "http://www.example.com/test",
  3295. "href": "http://www.example.com/aaa/test.txt",
  3296. "origin": "http://www.example.com",
  3297. "protocol": "http:",
  3298. "username": "",
  3299. "password": "",
  3300. "host": "www.example.com",
  3301. "hostname": "www.example.com",
  3302. "port": "",
  3303. "pathname": "/aaa/test.txt",
  3304. "search": "",
  3305. "hash": ""
  3306. },
  3307. {
  3308. "input": "../../test.txt",
  3309. "base": "http://www.example.com/test",
  3310. "href": "http://www.example.com/test.txt",
  3311. "origin": "http://www.example.com",
  3312. "protocol": "http:",
  3313. "username": "",
  3314. "password": "",
  3315. "host": "www.example.com",
  3316. "hostname": "www.example.com",
  3317. "port": "",
  3318. "pathname": "/test.txt",
  3319. "search": "",
  3320. "hash": ""
  3321. },
  3322. {
  3323. "input": "中/test.txt",
  3324. "base": "http://www.example.com/test",
  3325. "href": "http://www.example.com/%E4%B8%AD/test.txt",
  3326. "origin": "http://www.example.com",
  3327. "protocol": "http:",
  3328. "username": "",
  3329. "password": "",
  3330. "host": "www.example.com",
  3331. "hostname": "www.example.com",
  3332. "port": "",
  3333. "pathname": "/%E4%B8%AD/test.txt",
  3334. "search": "",
  3335. "hash": ""
  3336. },
  3337. {
  3338. "input": "http://www.example2.com",
  3339. "base": "http://www.example.com/test",
  3340. "href": "http://www.example2.com/",
  3341. "origin": "http://www.example2.com",
  3342. "protocol": "http:",
  3343. "username": "",
  3344. "password": "",
  3345. "host": "www.example2.com",
  3346. "hostname": "www.example2.com",
  3347. "port": "",
  3348. "pathname": "/",
  3349. "search": "",
  3350. "hash": ""
  3351. },
  3352. {
  3353. "input": "//www.example2.com",
  3354. "base": "http://www.example.com/test",
  3355. "href": "http://www.example2.com/",
  3356. "origin": "http://www.example2.com",
  3357. "protocol": "http:",
  3358. "username": "",
  3359. "password": "",
  3360. "host": "www.example2.com",
  3361. "hostname": "www.example2.com",
  3362. "port": "",
  3363. "pathname": "/",
  3364. "search": "",
  3365. "hash": ""
  3366. },
  3367. {
  3368. "input": "file:...",
  3369. "base": "http://www.example.com/test",
  3370. "href": "file:///...",
  3371. "protocol": "file:",
  3372. "username": "",
  3373. "password": "",
  3374. "host": "",
  3375. "hostname": "",
  3376. "port": "",
  3377. "pathname": "/...",
  3378. "search": "",
  3379. "hash": ""
  3380. },
  3381. {
  3382. "input": "file:..",
  3383. "base": "http://www.example.com/test",
  3384. "href": "file:///",
  3385. "protocol": "file:",
  3386. "username": "",
  3387. "password": "",
  3388. "host": "",
  3389. "hostname": "",
  3390. "port": "",
  3391. "pathname": "/",
  3392. "search": "",
  3393. "hash": ""
  3394. },
  3395. {
  3396. "input": "file:a",
  3397. "base": "http://www.example.com/test",
  3398. "href": "file:///a",
  3399. "protocol": "file:",
  3400. "username": "",
  3401. "password": "",
  3402. "host": "",
  3403. "hostname": "",
  3404. "port": "",
  3405. "pathname": "/a",
  3406. "search": "",
  3407. "hash": ""
  3408. },
  3409. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
  3410. "Basic canonicalization, uppercase should be converted to lowercase",
  3411. {
  3412. "input": "http://ExAmPlE.CoM",
  3413. "base": "http://other.com/",
  3414. "href": "http://example.com/",
  3415. "origin": "http://example.com",
  3416. "protocol": "http:",
  3417. "username": "",
  3418. "password": "",
  3419. "host": "example.com",
  3420. "hostname": "example.com",
  3421. "port": "",
  3422. "pathname": "/",
  3423. "search": "",
  3424. "hash": ""
  3425. },
  3426. {
  3427. "input": "http://example example.com",
  3428. "base": "http://other.com/",
  3429. "failure": true
  3430. },
  3431. {
  3432. "input": "http://Goo%20 goo%7C|.com",
  3433. "base": "http://other.com/",
  3434. "failure": true
  3435. },
  3436. {
  3437. "input": "http://[]",
  3438. "base": "http://other.com/",
  3439. "failure": true
  3440. },
  3441. {
  3442. "input": "http://[:]",
  3443. "base": "http://other.com/",
  3444. "failure": true
  3445. },
  3446. "U+3000 is mapped to U+0020 (space) which is disallowed",
  3447. {
  3448. "input": "http://GOO\u00a0\u3000goo.com",
  3449. "base": "http://other.com/",
  3450. "failure": true
  3451. },
  3452. "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",
  3453. {
  3454. "input": "http://GOO\u200b\u2060\ufeffgoo.com",
  3455. "base": "http://other.com/",
  3456. "href": "http://googoo.com/",
  3457. "origin": "http://googoo.com",
  3458. "protocol": "http:",
  3459. "username": "",
  3460. "password": "",
  3461. "host": "googoo.com",
  3462. "hostname": "googoo.com",
  3463. "port": "",
  3464. "pathname": "/",
  3465. "search": "",
  3466. "hash": ""
  3467. },
  3468. "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
  3469. {
  3470. "input": "http://www.foo。bar.com",
  3471. "base": "http://other.com/",
  3472. "href": "http://www.foo.bar.com/",
  3473. "origin": "http://www.foo.bar.com",
  3474. "protocol": "http:",
  3475. "username": "",
  3476. "password": "",
  3477. "host": "www.foo.bar.com",
  3478. "hostname": "www.foo.bar.com",
  3479. "port": "",
  3480. "pathname": "/",
  3481. "search": "",
  3482. "hash": ""
  3483. },
  3484. "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0",
  3485. {
  3486. "input": "http://\ufdd0zyx.com",
  3487. "base": "http://other.com/",
  3488. "failure": true
  3489. },
  3490. "This is the same as previous but escaped",
  3491. {
  3492. "input": "http://%ef%b7%90zyx.com",
  3493. "base": "http://other.com/",
  3494. "failure": true
  3495. },
  3496. "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.",
  3497. {
  3498. "input": "http://Go.com",
  3499. "base": "http://other.com/",
  3500. "href": "http://go.com/",
  3501. "origin": "http://go.com",
  3502. "protocol": "http:",
  3503. "username": "",
  3504. "password": "",
  3505. "host": "go.com",
  3506. "hostname": "go.com",
  3507. "port": "",
  3508. "pathname": "/",
  3509. "search": "",
  3510. "hash": ""
  3511. },
  3512. "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257",
  3513. {
  3514. "input": "http://%41.com",
  3515. "base": "http://other.com/",
  3516. "failure": true
  3517. },
  3518. {
  3519. "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com",
  3520. "base": "http://other.com/",
  3521. "failure": true
  3522. },
  3523. "...%00 in fullwidth should fail (also as escaped UTF-8 input)",
  3524. {
  3525. "input": "http://%00.com",
  3526. "base": "http://other.com/",
  3527. "failure": true
  3528. },
  3529. {
  3530. "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com",
  3531. "base": "http://other.com/",
  3532. "failure": true
  3533. },
  3534. "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
  3535. {
  3536. "input": "http://你好你好",
  3537. "base": "http://other.com/",
  3538. "href": "http://xn--6qqa088eba/",
  3539. "origin": "http://你好你好",
  3540. "protocol": "http:",
  3541. "username": "",
  3542. "password": "",
  3543. "host": "xn--6qqa088eba",
  3544. "hostname": "xn--6qqa088eba",
  3545. "port": "",
  3546. "pathname": "/",
  3547. "search": "",
  3548. "hash": ""
  3549. },
  3550. "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191",
  3551. {
  3552. "input": "http://%zz%66%a.com",
  3553. "base": "http://other.com/",
  3554. "failure": true
  3555. },
  3556. "If we get an invalid character that has been escaped.",
  3557. {
  3558. "input": "http://%25",
  3559. "base": "http://other.com/",
  3560. "failure": true
  3561. },
  3562. {
  3563. "input": "http://hello%00",
  3564. "base": "http://other.com/",
  3565. "failure": true
  3566. },
  3567. "Escaped numbers should be treated like IP addresses if they are.",
  3568. {
  3569. "input": "http://%30%78%63%30%2e%30%32%35%30.01",
  3570. "base": "http://other.com/",
  3571. "href": "http://192.168.0.1/",
  3572. "origin": "http://192.168.0.1",
  3573. "protocol": "http:",
  3574. "username": "",
  3575. "password": "",
  3576. "host": "192.168.0.1",
  3577. "hostname": "192.168.0.1",
  3578. "port": "",
  3579. "pathname": "/",
  3580. "search": "",
  3581. "hash": ""
  3582. },
  3583. {
  3584. "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e",
  3585. "base": "http://other.com/",
  3586. "href": "http://192.168.0.1/",
  3587. "origin": "http://192.168.0.1",
  3588. "protocol": "http:",
  3589. "username": "",
  3590. "password": "",
  3591. "host": "192.168.0.1",
  3592. "hostname": "192.168.0.1",
  3593. "port": "",
  3594. "pathname": "/",
  3595. "search": "",
  3596. "hash": ""
  3597. },
  3598. {
  3599. "input": "http://192.168.0.257",
  3600. "base": "http://other.com/",
  3601. "failure": true
  3602. },
  3603. "Invalid escaping should trigger the regular host error handling",
  3604. {
  3605. "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01",
  3606. "base": "http://other.com/",
  3607. "failure": true
  3608. },
  3609. "Something that isn't exactly an IP should get treated as a host and spaces escaped",
  3610. {
  3611. "input": "http://192.168.0.1 hello",
  3612. "base": "http://other.com/",
  3613. "failure": true
  3614. },
  3615. "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
  3616. {
  3617. "input": "http://0Xc0.0250.01",
  3618. "base": "http://other.com/",
  3619. "href": "http://192.168.0.1/",
  3620. "origin": "http://192.168.0.1",
  3621. "protocol": "http:",
  3622. "username": "",
  3623. "password": "",
  3624. "host": "192.168.0.1",
  3625. "hostname": "192.168.0.1",
  3626. "port": "",
  3627. "pathname": "/",
  3628. "search": "",
  3629. "hash": ""
  3630. },
  3631. "Broken IPv6",
  3632. {
  3633. "input": "http://[google.com]",
  3634. "base": "http://other.com/",
  3635. "failure": true
  3636. },
  3637. "Misc Unicode",
  3638. {
  3639. "input": "http://foo:💩@example.com/bar",
  3640. "base": "http://other.com/",
  3641. "href": "http://foo:%F0%9F%92%A9@example.com/bar",
  3642. "origin": "http://example.com",
  3643. "protocol": "http:",
  3644. "username": "foo",
  3645. "password": "%F0%9F%92%A9",
  3646. "host": "example.com",
  3647. "hostname": "example.com",
  3648. "port": "",
  3649. "pathname": "/bar",
  3650. "search": "",
  3651. "hash": ""
  3652. },
  3653. "# resolving a fragment against any scheme succeeds",
  3654. {
  3655. "input": "#",
  3656. "base": "test:test",
  3657. "href": "test:test#",
  3658. "origin": "null",
  3659. "protocol": "test:",
  3660. "username": "",
  3661. "password": "",
  3662. "host": "",
  3663. "hostname": "",
  3664. "port": "",
  3665. "pathname": "test",
  3666. "search": "",
  3667. "hash": ""
  3668. },
  3669. {
  3670. "input": "#x",
  3671. "base": "mailto:x@x.com",
  3672. "href": "mailto:x@x.com#x",
  3673. "origin": "null",
  3674. "protocol": "mailto:",
  3675. "username": "",
  3676. "password": "",
  3677. "host": "",
  3678. "hostname": "",
  3679. "port": "",
  3680. "pathname": "x@x.com",
  3681. "search": "",
  3682. "hash": "#x"
  3683. },
  3684. {
  3685. "input": "#x",
  3686. "base": "data:,",
  3687. "href": "data:,#x",
  3688. "origin": "null",
  3689. "protocol": "data:",
  3690. "username": "",
  3691. "password": "",
  3692. "host": "",
  3693. "hostname": "",
  3694. "port": "",
  3695. "pathname": ",",
  3696. "search": "",
  3697. "hash": "#x"
  3698. },
  3699. {
  3700. "input": "#x",
  3701. "base": "about:blank",
  3702. "href": "about:blank#x",
  3703. "origin": "null",
  3704. "protocol": "about:",
  3705. "username": "",
  3706. "password": "",
  3707. "host": "",
  3708. "hostname": "",
  3709. "port": "",
  3710. "pathname": "blank",
  3711. "search": "",
  3712. "hash": "#x"
  3713. },
  3714. {
  3715. "input": "#",
  3716. "base": "test:test?test",
  3717. "href": "test:test?test#",
  3718. "origin": "null",
  3719. "protocol": "test:",
  3720. "username": "",
  3721. "password": "",
  3722. "host": "",
  3723. "hostname": "",
  3724. "port": "",
  3725. "pathname": "test",
  3726. "search": "?test",
  3727. "hash": ""
  3728. },
  3729. "# multiple @ in authority state",
  3730. {
  3731. "input": "https://@test@test@example:800/",
  3732. "base": "http://doesnotmatter/",
  3733. "href": "https://%40test%40test@example:800/",
  3734. "origin": "https://example:800",
  3735. "protocol": "https:",
  3736. "username": "%40test%40test",
  3737. "password": "",
  3738. "host": "example:800",
  3739. "hostname": "example",
  3740. "port": "800",
  3741. "pathname": "/",
  3742. "search": "",
  3743. "hash": ""
  3744. },
  3745. {
  3746. "input": "https://@@@example",
  3747. "base": "http://doesnotmatter/",
  3748. "href": "https://%40%40@example/",
  3749. "origin": "https://example",
  3750. "protocol": "https:",
  3751. "username": "%40%40",
  3752. "password": "",
  3753. "host": "example",
  3754. "hostname": "example",
  3755. "port": "",
  3756. "pathname": "/",
  3757. "search": "",
  3758. "hash": ""
  3759. },
  3760. "non-az-09 characters",
  3761. {
  3762. "input": "http://`{}:`{}@h/`{}?`{}",
  3763. "base": "http://doesnotmatter/",
  3764. "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}",
  3765. "origin": "http://h",
  3766. "protocol": "http:",
  3767. "username": "%60%7B%7D",
  3768. "password": "%60%7B%7D",
  3769. "host": "h",
  3770. "hostname": "h",
  3771. "port": "",
  3772. "pathname": "/%60%7B%7D",
  3773. "search": "?`{}",
  3774. "hash": ""
  3775. },
  3776. "# Credentials in base",
  3777. {
  3778. "input": "/some/path",
  3779. "base": "http://user@example.org/smth",
  3780. "href": "http://user@example.org/some/path",
  3781. "origin": "http://example.org",
  3782. "protocol": "http:",
  3783. "username": "user",
  3784. "password": "",
  3785. "host": "example.org",
  3786. "hostname": "example.org",
  3787. "port": "",
  3788. "pathname": "/some/path",
  3789. "search": "",
  3790. "hash": ""
  3791. },
  3792. {
  3793. "input": "",
  3794. "base": "http://user:pass@example.org:21/smth",
  3795. "href": "http://user:pass@example.org:21/smth",
  3796. "origin": "http://example.org:21",
  3797. "protocol": "http:",
  3798. "username": "user",
  3799. "password": "pass",
  3800. "host": "example.org:21",
  3801. "hostname": "example.org",
  3802. "port": "21",
  3803. "pathname": "/smth",
  3804. "search": "",
  3805. "hash": ""
  3806. },
  3807. {
  3808. "input": "/some/path",
  3809. "base": "http://user:pass@example.org:21/smth",
  3810. "href": "http://user:pass@example.org:21/some/path",
  3811. "origin": "http://example.org:21",
  3812. "protocol": "http:",
  3813. "username": "user",
  3814. "password": "pass",
  3815. "host": "example.org:21",
  3816. "hostname": "example.org",
  3817. "port": "21",
  3818. "pathname": "/some/path",
  3819. "search": "",
  3820. "hash": ""
  3821. },
  3822. "# a set of tests designed by zcorpan for relative URLs with unknown schemes",
  3823. {
  3824. "input": "i",
  3825. "base": "sc:sd",
  3826. "failure": true
  3827. },
  3828. {
  3829. "input": "i",
  3830. "base": "sc:sd/sd",
  3831. "failure": true
  3832. },
  3833. {
  3834. "input": "i",
  3835. "base": "sc:/pa/pa",
  3836. "href": "sc:/pa/i",
  3837. "origin": "null",
  3838. "protocol": "sc:",
  3839. "username": "",
  3840. "password": "",
  3841. "host": "",
  3842. "hostname": "",
  3843. "port": "",
  3844. "pathname": "/pa/i",
  3845. "search": "",
  3846. "hash": ""
  3847. },
  3848. {
  3849. "input": "i",
  3850. "base": "sc://ho/pa",
  3851. "href": "sc://ho/i",
  3852. "origin": "null",
  3853. "protocol": "sc:",
  3854. "username": "",
  3855. "password": "",
  3856. "host": "ho",
  3857. "hostname": "ho",
  3858. "port": "",
  3859. "pathname": "/i",
  3860. "search": "",
  3861. "hash": ""
  3862. },
  3863. {
  3864. "input": "i",
  3865. "base": "sc:///pa/pa",
  3866. "href": "sc:///pa/i",
  3867. "origin": "null",
  3868. "protocol": "sc:",
  3869. "username": "",
  3870. "password": "",
  3871. "host": "",
  3872. "hostname": "",
  3873. "port": "",
  3874. "pathname": "/pa/i",
  3875. "search": "",
  3876. "hash": ""
  3877. },
  3878. {
  3879. "input": "../i",
  3880. "base": "sc:sd",
  3881. "failure": true
  3882. },
  3883. {
  3884. "input": "../i",
  3885. "base": "sc:sd/sd",
  3886. "failure": true
  3887. },
  3888. {
  3889. "input": "../i",
  3890. "base": "sc:/pa/pa",
  3891. "href": "sc:/i",
  3892. "origin": "null",
  3893. "protocol": "sc:",
  3894. "username": "",
  3895. "password": "",
  3896. "host": "",
  3897. "hostname": "",
  3898. "port": "",
  3899. "pathname": "/i",
  3900. "search": "",
  3901. "hash": ""
  3902. },
  3903. {
  3904. "input": "../i",
  3905. "base": "sc://ho/pa",
  3906. "href": "sc://ho/i",
  3907. "origin": "null",
  3908. "protocol": "sc:",
  3909. "username": "",
  3910. "password": "",
  3911. "host": "ho",
  3912. "hostname": "ho",
  3913. "port": "",
  3914. "pathname": "/i",
  3915. "search": "",
  3916. "hash": ""
  3917. },
  3918. {
  3919. "input": "../i",
  3920. "base": "sc:///pa/pa",
  3921. "href": "sc:///i",
  3922. "origin": "null",
  3923. "protocol": "sc:",
  3924. "username": "",
  3925. "password": "",
  3926. "host": "",
  3927. "hostname": "",
  3928. "port": "",
  3929. "pathname": "/i",
  3930. "search": "",
  3931. "hash": ""
  3932. },
  3933. {
  3934. "input": "/i",
  3935. "base": "sc:sd",
  3936. "failure": true
  3937. },
  3938. {
  3939. "input": "/i",
  3940. "base": "sc:sd/sd",
  3941. "failure": true
  3942. },
  3943. {
  3944. "input": "/i",
  3945. "base": "sc:/pa/pa",
  3946. "href": "sc:/i",
  3947. "origin": "null",
  3948. "protocol": "sc:",
  3949. "username": "",
  3950. "password": "",
  3951. "host": "",
  3952. "hostname": "",
  3953. "port": "",
  3954. "pathname": "/i",
  3955. "search": "",
  3956. "hash": ""
  3957. },
  3958. {
  3959. "input": "/i",
  3960. "base": "sc://ho/pa",
  3961. "href": "sc://ho/i",
  3962. "origin": "null",
  3963. "protocol": "sc:",
  3964. "username": "",
  3965. "password": "",
  3966. "host": "ho",
  3967. "hostname": "ho",
  3968. "port": "",
  3969. "pathname": "/i",
  3970. "search": "",
  3971. "hash": ""
  3972. },
  3973. {
  3974. "input": "/i",
  3975. "base": "sc:///pa/pa",
  3976. "href": "sc:///i",
  3977. "origin": "null",
  3978. "protocol": "sc:",
  3979. "username": "",
  3980. "password": "",
  3981. "host": "",
  3982. "hostname": "",
  3983. "port": "",
  3984. "pathname": "/i",
  3985. "search": "",
  3986. "hash": ""
  3987. },
  3988. {
  3989. "input": "?i",
  3990. "base": "sc:sd",
  3991. "failure": true
  3992. },
  3993. {
  3994. "input": "?i",
  3995. "base": "sc:sd/sd",
  3996. "failure": true
  3997. },
  3998. {
  3999. "input": "?i",
  4000. "base": "sc:/pa/pa",
  4001. "href": "sc:/pa/pa?i",
  4002. "origin": "null",
  4003. "protocol": "sc:",
  4004. "username": "",
  4005. "password": "",
  4006. "host": "",
  4007. "hostname": "",
  4008. "port": "",
  4009. "pathname": "/pa/pa",
  4010. "search": "?i",
  4011. "hash": ""
  4012. },
  4013. {
  4014. "input": "?i",
  4015. "base": "sc://ho/pa",
  4016. "href": "sc://ho/pa?i",
  4017. "origin": "null",
  4018. "protocol": "sc:",
  4019. "username": "",
  4020. "password": "",
  4021. "host": "ho",
  4022. "hostname": "ho",
  4023. "port": "",
  4024. "pathname": "/pa",
  4025. "search": "?i",
  4026. "hash": ""
  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": "?i",
  4041. "hash": ""
  4042. },
  4043. {
  4044. "input": "#i",
  4045. "base": "sc:sd",
  4046. "href": "sc:sd#i",
  4047. "origin": "null",
  4048. "protocol": "sc:",
  4049. "username": "",
  4050. "password": "",
  4051. "host": "",
  4052. "hostname": "",
  4053. "port": "",
  4054. "pathname": "sd",
  4055. "search": "",
  4056. "hash": "#i"
  4057. },
  4058. {
  4059. "input": "#i",
  4060. "base": "sc:sd/sd",
  4061. "href": "sc:sd/sd#i",
  4062. "origin": "null",
  4063. "protocol": "sc:",
  4064. "username": "",
  4065. "password": "",
  4066. "host": "",
  4067. "hostname": "",
  4068. "port": "",
  4069. "pathname": "sd/sd",
  4070. "search": "",
  4071. "hash": "#i"
  4072. },
  4073. {
  4074. "input": "#i",
  4075. "base": "sc:/pa/pa",
  4076. "href": "sc:/pa/pa#i",
  4077. "origin": "null",
  4078. "protocol": "sc:",
  4079. "username": "",
  4080. "password": "",
  4081. "host": "",
  4082. "hostname": "",
  4083. "port": "",
  4084. "pathname": "/pa/pa",
  4085. "search": "",
  4086. "hash": "#i"
  4087. },
  4088. {
  4089. "input": "#i",
  4090. "base": "sc://ho/pa",
  4091. "href": "sc://ho/pa#i",
  4092. "origin": "null",
  4093. "protocol": "sc:",
  4094. "username": "",
  4095. "password": "",
  4096. "host": "ho",
  4097. "hostname": "ho",
  4098. "port": "",
  4099. "pathname": "/pa",
  4100. "search": "",
  4101. "hash": "#i"
  4102. },
  4103. {
  4104. "input": "#i",
  4105. "base": "sc:///pa/pa",
  4106. "href": "sc:///pa/pa#i",
  4107. "origin": "null",
  4108. "protocol": "sc:",
  4109. "username": "",
  4110. "password": "",
  4111. "host": "",
  4112. "hostname": "",
  4113. "port": "",
  4114. "pathname": "/pa/pa",
  4115. "search": "",
  4116. "hash": "#i"
  4117. },
  4118. "# make sure that relative URL logic works on known typically non-relative schemes too",
  4119. {
  4120. "input": "about:/../",
  4121. "base": "about:blank",
  4122. "href": "about:/",
  4123. "origin": "null",
  4124. "protocol": "about:",
  4125. "username": "",
  4126. "password": "",
  4127. "host": "",
  4128. "hostname": "",
  4129. "port": "",
  4130. "pathname": "/",
  4131. "search": "",
  4132. "hash": ""
  4133. },
  4134. {
  4135. "input": "data:/../",
  4136. "base": "about:blank",
  4137. "href": "data:/",
  4138. "origin": "null",
  4139. "protocol": "data:",
  4140. "username": "",
  4141. "password": "",
  4142. "host": "",
  4143. "hostname": "",
  4144. "port": "",
  4145. "pathname": "/",
  4146. "search": "",
  4147. "hash": ""
  4148. },
  4149. {
  4150. "input": "javascript:/../",
  4151. "base": "about:blank",
  4152. "href": "javascript:/",
  4153. "origin": "null",
  4154. "protocol": "javascript:",
  4155. "username": "",
  4156. "password": "",
  4157. "host": "",
  4158. "hostname": "",
  4159. "port": "",
  4160. "pathname": "/",
  4161. "search": "",
  4162. "hash": ""
  4163. },
  4164. {
  4165. "input": "mailto:/../",
  4166. "base": "about:blank",
  4167. "href": "mailto:/",
  4168. "origin": "null",
  4169. "protocol": "mailto:",
  4170. "username": "",
  4171. "password": "",
  4172. "host": "",
  4173. "hostname": "",
  4174. "port": "",
  4175. "pathname": "/",
  4176. "search": "",
  4177. "hash": ""
  4178. },
  4179. "# unknown schemes and non-ASCII domains",
  4180. {
  4181. "input": "sc://ñ.test/",
  4182. "base": "about:blank",
  4183. "href": "sc://xn--ida.test/",
  4184. "origin": "null",
  4185. "protocol": "sc:",
  4186. "username": "",
  4187. "password": "",
  4188. "host": "xn--ida.test",
  4189. "hostname": "xn--ida.test",
  4190. "port": "",
  4191. "pathname": "/",
  4192. "search": "",
  4193. "hash": ""
  4194. },
  4195. "# unknown schemes and backslashes",
  4196. {
  4197. "input": "sc:\\../",
  4198. "base": "about:blank",
  4199. "href": "sc:\\../",
  4200. "origin": "null",
  4201. "protocol": "sc:",
  4202. "username": "",
  4203. "password": "",
  4204. "host": "",
  4205. "hostname": "",
  4206. "port": "",
  4207. "pathname": "\\../",
  4208. "search": "",
  4209. "hash": ""
  4210. },
  4211. "# unknown scheme with path looking like a password",
  4212. {
  4213. "input": "sc::a@example.net",
  4214. "base": "about:blank",
  4215. "href": "sc::a@example.net",
  4216. "origin": "null",
  4217. "protocol": "sc:",
  4218. "username": "",
  4219. "password": "",
  4220. "host": "",
  4221. "hostname": "",
  4222. "port": "",
  4223. "pathname": ":a@example.net",
  4224. "search": "",
  4225. "hash": ""
  4226. },
  4227. "# tests from jsdom/whatwg-url designed for code coverage",
  4228. {
  4229. "input": "http://127.0.0.1:10100/relative_import.html",
  4230. "base": "about:blank",
  4231. "href": "http://127.0.0.1:10100/relative_import.html",
  4232. "origin": "http://127.0.0.1:10100",
  4233. "protocol": "http:",
  4234. "username": "",
  4235. "password": "",
  4236. "host": "127.0.0.1:10100",
  4237. "hostname": "127.0.0.1",
  4238. "port": "10100",
  4239. "pathname": "/relative_import.html",
  4240. "search": "",
  4241. "hash": ""
  4242. },
  4243. {
  4244. "input": "http://facebook.com/?foo=%7B%22abc%22",
  4245. "base": "about:blank",
  4246. "href": "http://facebook.com/?foo=%7B%22abc%22",
  4247. "origin": "http://facebook.com",
  4248. "protocol": "http:",
  4249. "username": "",
  4250. "password": "",
  4251. "host": "facebook.com",
  4252. "hostname": "facebook.com",
  4253. "port": "",
  4254. "pathname": "/",
  4255. "search": "?foo=%7B%22abc%22",
  4256. "hash": ""
  4257. },
  4258. {
  4259. "input": "https://localhost:3000/jqueryui@1.2.3",
  4260. "base": "about:blank",
  4261. "href": "https://localhost:3000/jqueryui@1.2.3",
  4262. "origin": "https://localhost:3000",
  4263. "protocol": "https:",
  4264. "username": "",
  4265. "password": "",
  4266. "host": "localhost:3000",
  4267. "hostname": "localhost",
  4268. "port": "3000",
  4269. "pathname": "/jqueryui@1.2.3",
  4270. "search": "",
  4271. "hash": ""
  4272. },
  4273. "# tab/LF/CR",
  4274. {
  4275. "input": "h\tt\nt\rp://h\to\ns\rt:9\t0\n0\r0/p\ta\nt\rh?q\tu\ne\rry#f\tr\na\rg",
  4276. "base": "about:blank",
  4277. "href": "http://host:9000/path?query#frag",
  4278. "origin": "http://host:9000",
  4279. "protocol": "http:",
  4280. "username": "",
  4281. "password": "",
  4282. "host": "host:9000",
  4283. "hostname": "host",
  4284. "port": "9000",
  4285. "pathname": "/path",
  4286. "search": "?query",
  4287. "hash": "#frag"
  4288. },
  4289. "# Stringification of URL.searchParams",
  4290. {
  4291. "input": "?a=b&c=d",
  4292. "base": "http://example.org/foo/bar",
  4293. "href": "http://example.org/foo/bar?a=b&c=d",
  4294. "origin": "http://example.org",
  4295. "protocol": "http:",
  4296. "username": "",
  4297. "password": "",
  4298. "host": "example.org",
  4299. "hostname": "example.org",
  4300. "port": "",
  4301. "pathname": "/foo/bar",
  4302. "search": "?a=b&c=d",
  4303. "searchParams": "a=b&c=d",
  4304. "hash": ""
  4305. },
  4306. {
  4307. "input": "??a=b&c=d",
  4308. "base": "http://example.org/foo/bar",
  4309. "href": "http://example.org/foo/bar??a=b&c=d",
  4310. "origin": "http://example.org",
  4311. "protocol": "http:",
  4312. "username": "",
  4313. "password": "",
  4314. "host": "example.org",
  4315. "hostname": "example.org",
  4316. "port": "",
  4317. "pathname": "/foo/bar",
  4318. "search": "??a=b&c=d",
  4319. "searchParams": "%3Fa=b&c=d",
  4320. "hash": ""
  4321. },
  4322. "# Scheme only",
  4323. {
  4324. "input": "http:",
  4325. "base": "http://example.org/foo/bar",
  4326. "href": "http://example.org/foo/bar",
  4327. "origin": "http://example.org",
  4328. "protocol": "http:",
  4329. "username": "",
  4330. "password": "",
  4331. "host": "example.org",
  4332. "hostname": "example.org",
  4333. "port": "",
  4334. "pathname": "/foo/bar",
  4335. "search": "",
  4336. "searchParams": "",
  4337. "hash": ""
  4338. },
  4339. {
  4340. "input": "http:",
  4341. "base": "https://example.org/foo/bar",
  4342. "failure": true
  4343. },
  4344. {
  4345. "input": "sc:",
  4346. "base": "https://example.org/foo/bar",
  4347. "href": "sc:",
  4348. "origin": "null",
  4349. "protocol": "sc:",
  4350. "username": "",
  4351. "password": "",
  4352. "host": "",
  4353. "hostname": "",
  4354. "port": "",
  4355. "pathname": "",
  4356. "search": "",
  4357. "searchParams": "",
  4358. "hash": ""
  4359. },
  4360. "# Percent encoding of fragments",
  4361. {
  4362. "input": "http://foo.bar/baz?qux#foo\bbar",
  4363. "base": "about:blank",
  4364. "href": "http://foo.bar/baz?qux#foo%08bar",
  4365. "origin": "http://foo.bar",
  4366. "protocol": "http:",
  4367. "username": "",
  4368. "password": "",
  4369. "host": "foo.bar",
  4370. "hostname": "foo.bar",
  4371. "port": "",
  4372. "pathname": "/baz",
  4373. "search": "?qux",
  4374. "searchParams": "",
  4375. "hash": "#foo%08bar"
  4376. }
  4377. ]