urltestdata.json 94 KB

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