urltestdata.json 133 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075
  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": "https://test:@test",
  35. "base": "about:blank",
  36. "href": "https://test@test/",
  37. "origin": "https://test",
  38. "protocol": "https:",
  39. "username": "test",
  40. "password": "",
  41. "host": "test",
  42. "hostname": "test",
  43. "port": "",
  44. "pathname": "/",
  45. "search": "",
  46. "hash": ""
  47. },
  48. {
  49. "input": "https://:@test",
  50. "base": "about:blank",
  51. "href": "https://test/",
  52. "origin": "https://test",
  53. "protocol": "https:",
  54. "username": "",
  55. "password": "",
  56. "host": "test",
  57. "hostname": "test",
  58. "port": "",
  59. "pathname": "/",
  60. "search": "",
  61. "hash": ""
  62. },
  63. {
  64. "input": "non-special://test:@test/x",
  65. "base": "about:blank",
  66. "href": "non-special://test@test/x",
  67. "origin": "null",
  68. "protocol": "non-special:",
  69. "username": "test",
  70. "password": "",
  71. "host": "test",
  72. "hostname": "test",
  73. "port": "",
  74. "pathname": "/x",
  75. "search": "",
  76. "hash": ""
  77. },
  78. {
  79. "input": "non-special://:@test/x",
  80. "base": "about:blank",
  81. "href": "non-special://test/x",
  82. "origin": "null",
  83. "protocol": "non-special:",
  84. "username": "",
  85. "password": "",
  86. "host": "test",
  87. "hostname": "test",
  88. "port": "",
  89. "pathname": "/x",
  90. "search": "",
  91. "hash": ""
  92. },
  93. {
  94. "input": "http:foo.com",
  95. "base": "http://example.org/foo/bar",
  96. "href": "http://example.org/foo/foo.com",
  97. "origin": "http://example.org",
  98. "protocol": "http:",
  99. "username": "",
  100. "password": "",
  101. "host": "example.org",
  102. "hostname": "example.org",
  103. "port": "",
  104. "pathname": "/foo/foo.com",
  105. "search": "",
  106. "hash": ""
  107. },
  108. {
  109. "input": "\t :foo.com \n",
  110. "base": "http://example.org/foo/bar",
  111. "href": "http://example.org/foo/:foo.com",
  112. "origin": "http://example.org",
  113. "protocol": "http:",
  114. "username": "",
  115. "password": "",
  116. "host": "example.org",
  117. "hostname": "example.org",
  118. "port": "",
  119. "pathname": "/foo/:foo.com",
  120. "search": "",
  121. "hash": ""
  122. },
  123. {
  124. "input": " foo.com ",
  125. "base": "http://example.org/foo/bar",
  126. "href": "http://example.org/foo/foo.com",
  127. "origin": "http://example.org",
  128. "protocol": "http:",
  129. "username": "",
  130. "password": "",
  131. "host": "example.org",
  132. "hostname": "example.org",
  133. "port": "",
  134. "pathname": "/foo/foo.com",
  135. "search": "",
  136. "hash": ""
  137. },
  138. {
  139. "input": "a:\t foo.com",
  140. "base": "http://example.org/foo/bar",
  141. "href": "a: foo.com",
  142. "origin": "null",
  143. "protocol": "a:",
  144. "username": "",
  145. "password": "",
  146. "host": "",
  147. "hostname": "",
  148. "port": "",
  149. "pathname": " foo.com",
  150. "search": "",
  151. "hash": ""
  152. },
  153. {
  154. "input": "http://f:21/ b ? d # e ",
  155. "base": "http://example.org/foo/bar",
  156. "href": "http://f:21/%20b%20?%20d%20# e",
  157. "origin": "http://f:21",
  158. "protocol": "http:",
  159. "username": "",
  160. "password": "",
  161. "host": "f:21",
  162. "hostname": "f",
  163. "port": "21",
  164. "pathname": "/%20b%20",
  165. "search": "?%20d%20",
  166. "hash": "# e"
  167. },
  168. {
  169. "input": "lolscheme:x x#x x",
  170. "base": "about:blank",
  171. "href": "lolscheme:x x#x x",
  172. "protocol": "lolscheme:",
  173. "username": "",
  174. "password": "",
  175. "host": "",
  176. "hostname": "",
  177. "port": "",
  178. "pathname": "x x",
  179. "search": "",
  180. "hash": "#x x"
  181. },
  182. {
  183. "input": "http://f:/c",
  184. "base": "http://example.org/foo/bar",
  185. "href": "http://f/c",
  186. "origin": "http://f",
  187. "protocol": "http:",
  188. "username": "",
  189. "password": "",
  190. "host": "f",
  191. "hostname": "f",
  192. "port": "",
  193. "pathname": "/c",
  194. "search": "",
  195. "hash": ""
  196. },
  197. {
  198. "input": "http://f:0/c",
  199. "base": "http://example.org/foo/bar",
  200. "href": "http://f:0/c",
  201. "origin": "http://f:0",
  202. "protocol": "http:",
  203. "username": "",
  204. "password": "",
  205. "host": "f:0",
  206. "hostname": "f",
  207. "port": "0",
  208. "pathname": "/c",
  209. "search": "",
  210. "hash": ""
  211. },
  212. {
  213. "input": "http://f:00000000000000/c",
  214. "base": "http://example.org/foo/bar",
  215. "href": "http://f:0/c",
  216. "origin": "http://f:0",
  217. "protocol": "http:",
  218. "username": "",
  219. "password": "",
  220. "host": "f:0",
  221. "hostname": "f",
  222. "port": "0",
  223. "pathname": "/c",
  224. "search": "",
  225. "hash": ""
  226. },
  227. {
  228. "input": "http://f:00000000000000000000080/c",
  229. "base": "http://example.org/foo/bar",
  230. "href": "http://f/c",
  231. "origin": "http://f",
  232. "protocol": "http:",
  233. "username": "",
  234. "password": "",
  235. "host": "f",
  236. "hostname": "f",
  237. "port": "",
  238. "pathname": "/c",
  239. "search": "",
  240. "hash": ""
  241. },
  242. {
  243. "input": "http://f:b/c",
  244. "base": "http://example.org/foo/bar",
  245. "failure": true
  246. },
  247. {
  248. "input": "http://f: /c",
  249. "base": "http://example.org/foo/bar",
  250. "failure": true
  251. },
  252. {
  253. "input": "http://f:\n/c",
  254. "base": "http://example.org/foo/bar",
  255. "href": "http://f/c",
  256. "origin": "http://f",
  257. "protocol": "http:",
  258. "username": "",
  259. "password": "",
  260. "host": "f",
  261. "hostname": "f",
  262. "port": "",
  263. "pathname": "/c",
  264. "search": "",
  265. "hash": ""
  266. },
  267. {
  268. "input": "http://f:fifty-two/c",
  269. "base": "http://example.org/foo/bar",
  270. "failure": true
  271. },
  272. {
  273. "input": "http://f:999999/c",
  274. "base": "http://example.org/foo/bar",
  275. "failure": true
  276. },
  277. {
  278. "input": "non-special://f:999999/c",
  279. "base": "http://example.org/foo/bar",
  280. "failure": true
  281. },
  282. {
  283. "input": "http://f: 21 / b ? d # e ",
  284. "base": "http://example.org/foo/bar",
  285. "failure": true
  286. },
  287. {
  288. "input": "",
  289. "base": "http://example.org/foo/bar",
  290. "href": "http://example.org/foo/bar",
  291. "origin": "http://example.org",
  292. "protocol": "http:",
  293. "username": "",
  294. "password": "",
  295. "host": "example.org",
  296. "hostname": "example.org",
  297. "port": "",
  298. "pathname": "/foo/bar",
  299. "search": "",
  300. "hash": ""
  301. },
  302. {
  303. "input": " \t",
  304. "base": "http://example.org/foo/bar",
  305. "href": "http://example.org/foo/bar",
  306. "origin": "http://example.org",
  307. "protocol": "http:",
  308. "username": "",
  309. "password": "",
  310. "host": "example.org",
  311. "hostname": "example.org",
  312. "port": "",
  313. "pathname": "/foo/bar",
  314. "search": "",
  315. "hash": ""
  316. },
  317. {
  318. "input": ":foo.com/",
  319. "base": "http://example.org/foo/bar",
  320. "href": "http://example.org/foo/:foo.com/",
  321. "origin": "http://example.org",
  322. "protocol": "http:",
  323. "username": "",
  324. "password": "",
  325. "host": "example.org",
  326. "hostname": "example.org",
  327. "port": "",
  328. "pathname": "/foo/:foo.com/",
  329. "search": "",
  330. "hash": ""
  331. },
  332. {
  333. "input": ":foo.com\\",
  334. "base": "http://example.org/foo/bar",
  335. "href": "http://example.org/foo/:foo.com/",
  336. "origin": "http://example.org",
  337. "protocol": "http:",
  338. "username": "",
  339. "password": "",
  340. "host": "example.org",
  341. "hostname": "example.org",
  342. "port": "",
  343. "pathname": "/foo/:foo.com/",
  344. "search": "",
  345. "hash": ""
  346. },
  347. {
  348. "input": ":",
  349. "base": "http://example.org/foo/bar",
  350. "href": "http://example.org/foo/:",
  351. "origin": "http://example.org",
  352. "protocol": "http:",
  353. "username": "",
  354. "password": "",
  355. "host": "example.org",
  356. "hostname": "example.org",
  357. "port": "",
  358. "pathname": "/foo/:",
  359. "search": "",
  360. "hash": ""
  361. },
  362. {
  363. "input": ":a",
  364. "base": "http://example.org/foo/bar",
  365. "href": "http://example.org/foo/:a",
  366. "origin": "http://example.org",
  367. "protocol": "http:",
  368. "username": "",
  369. "password": "",
  370. "host": "example.org",
  371. "hostname": "example.org",
  372. "port": "",
  373. "pathname": "/foo/:a",
  374. "search": "",
  375. "hash": ""
  376. },
  377. {
  378. "input": ":/",
  379. "base": "http://example.org/foo/bar",
  380. "href": "http://example.org/foo/:/",
  381. "origin": "http://example.org",
  382. "protocol": "http:",
  383. "username": "",
  384. "password": "",
  385. "host": "example.org",
  386. "hostname": "example.org",
  387. "port": "",
  388. "pathname": "/foo/:/",
  389. "search": "",
  390. "hash": ""
  391. },
  392. {
  393. "input": ":\\",
  394. "base": "http://example.org/foo/bar",
  395. "href": "http://example.org/foo/:/",
  396. "origin": "http://example.org",
  397. "protocol": "http:",
  398. "username": "",
  399. "password": "",
  400. "host": "example.org",
  401. "hostname": "example.org",
  402. "port": "",
  403. "pathname": "/foo/:/",
  404. "search": "",
  405. "hash": ""
  406. },
  407. {
  408. "input": ":#",
  409. "base": "http://example.org/foo/bar",
  410. "href": "http://example.org/foo/:#",
  411. "origin": "http://example.org",
  412. "protocol": "http:",
  413. "username": "",
  414. "password": "",
  415. "host": "example.org",
  416. "hostname": "example.org",
  417. "port": "",
  418. "pathname": "/foo/:",
  419. "search": "",
  420. "hash": ""
  421. },
  422. {
  423. "input": "#",
  424. "base": "http://example.org/foo/bar",
  425. "href": "http://example.org/foo/bar#",
  426. "origin": "http://example.org",
  427. "protocol": "http:",
  428. "username": "",
  429. "password": "",
  430. "host": "example.org",
  431. "hostname": "example.org",
  432. "port": "",
  433. "pathname": "/foo/bar",
  434. "search": "",
  435. "hash": ""
  436. },
  437. {
  438. "input": "#/",
  439. "base": "http://example.org/foo/bar",
  440. "href": "http://example.org/foo/bar#/",
  441. "origin": "http://example.org",
  442. "protocol": "http:",
  443. "username": "",
  444. "password": "",
  445. "host": "example.org",
  446. "hostname": "example.org",
  447. "port": "",
  448. "pathname": "/foo/bar",
  449. "search": "",
  450. "hash": "#/"
  451. },
  452. {
  453. "input": "#\\",
  454. "base": "http://example.org/foo/bar",
  455. "href": "http://example.org/foo/bar#\\",
  456. "origin": "http://example.org",
  457. "protocol": "http:",
  458. "username": "",
  459. "password": "",
  460. "host": "example.org",
  461. "hostname": "example.org",
  462. "port": "",
  463. "pathname": "/foo/bar",
  464. "search": "",
  465. "hash": "#\\"
  466. },
  467. {
  468. "input": "#;?",
  469. "base": "http://example.org/foo/bar",
  470. "href": "http://example.org/foo/bar#;?",
  471. "origin": "http://example.org",
  472. "protocol": "http:",
  473. "username": "",
  474. "password": "",
  475. "host": "example.org",
  476. "hostname": "example.org",
  477. "port": "",
  478. "pathname": "/foo/bar",
  479. "search": "",
  480. "hash": "#;?"
  481. },
  482. {
  483. "input": "?",
  484. "base": "http://example.org/foo/bar",
  485. "href": "http://example.org/foo/bar?",
  486. "origin": "http://example.org",
  487. "protocol": "http:",
  488. "username": "",
  489. "password": "",
  490. "host": "example.org",
  491. "hostname": "example.org",
  492. "port": "",
  493. "pathname": "/foo/bar",
  494. "search": "",
  495. "hash": ""
  496. },
  497. {
  498. "input": "/",
  499. "base": "http://example.org/foo/bar",
  500. "href": "http://example.org/",
  501. "origin": "http://example.org",
  502. "protocol": "http:",
  503. "username": "",
  504. "password": "",
  505. "host": "example.org",
  506. "hostname": "example.org",
  507. "port": "",
  508. "pathname": "/",
  509. "search": "",
  510. "hash": ""
  511. },
  512. {
  513. "input": ":23",
  514. "base": "http://example.org/foo/bar",
  515. "href": "http://example.org/foo/:23",
  516. "origin": "http://example.org",
  517. "protocol": "http:",
  518. "username": "",
  519. "password": "",
  520. "host": "example.org",
  521. "hostname": "example.org",
  522. "port": "",
  523. "pathname": "/foo/:23",
  524. "search": "",
  525. "hash": ""
  526. },
  527. {
  528. "input": "/:23",
  529. "base": "http://example.org/foo/bar",
  530. "href": "http://example.org/:23",
  531. "origin": "http://example.org",
  532. "protocol": "http:",
  533. "username": "",
  534. "password": "",
  535. "host": "example.org",
  536. "hostname": "example.org",
  537. "port": "",
  538. "pathname": "/:23",
  539. "search": "",
  540. "hash": ""
  541. },
  542. {
  543. "input": "::",
  544. "base": "http://example.org/foo/bar",
  545. "href": "http://example.org/foo/::",
  546. "origin": "http://example.org",
  547. "protocol": "http:",
  548. "username": "",
  549. "password": "",
  550. "host": "example.org",
  551. "hostname": "example.org",
  552. "port": "",
  553. "pathname": "/foo/::",
  554. "search": "",
  555. "hash": ""
  556. },
  557. {
  558. "input": "::23",
  559. "base": "http://example.org/foo/bar",
  560. "href": "http://example.org/foo/::23",
  561. "origin": "http://example.org",
  562. "protocol": "http:",
  563. "username": "",
  564. "password": "",
  565. "host": "example.org",
  566. "hostname": "example.org",
  567. "port": "",
  568. "pathname": "/foo/::23",
  569. "search": "",
  570. "hash": ""
  571. },
  572. {
  573. "input": "foo://",
  574. "base": "http://example.org/foo/bar",
  575. "href": "foo:///",
  576. "origin": "null",
  577. "protocol": "foo:",
  578. "username": "",
  579. "password": "",
  580. "host": "",
  581. "hostname": "",
  582. "port": "",
  583. "pathname": "/",
  584. "search": "",
  585. "hash": ""
  586. },
  587. {
  588. "input": "http://a:b@c:29/d",
  589. "base": "http://example.org/foo/bar",
  590. "href": "http://a:b@c:29/d",
  591. "origin": "http://c:29",
  592. "protocol": "http:",
  593. "username": "a",
  594. "password": "b",
  595. "host": "c:29",
  596. "hostname": "c",
  597. "port": "29",
  598. "pathname": "/d",
  599. "search": "",
  600. "hash": ""
  601. },
  602. {
  603. "input": "http::@c:29",
  604. "base": "http://example.org/foo/bar",
  605. "href": "http://example.org/foo/:@c:29",
  606. "origin": "http://example.org",
  607. "protocol": "http:",
  608. "username": "",
  609. "password": "",
  610. "host": "example.org",
  611. "hostname": "example.org",
  612. "port": "",
  613. "pathname": "/foo/:@c:29",
  614. "search": "",
  615. "hash": ""
  616. },
  617. {
  618. "input": "http://&a:foo(b]c@d:2/",
  619. "base": "http://example.org/foo/bar",
  620. "href": "http://&a:foo(b%5Dc@d:2/",
  621. "origin": "http://d:2",
  622. "protocol": "http:",
  623. "username": "&a",
  624. "password": "foo(b%5Dc",
  625. "host": "d:2",
  626. "hostname": "d",
  627. "port": "2",
  628. "pathname": "/",
  629. "search": "",
  630. "hash": ""
  631. },
  632. {
  633. "input": "http://::@c@d:2",
  634. "base": "http://example.org/foo/bar",
  635. "href": "http://:%3A%40c@d:2/",
  636. "origin": "http://d:2",
  637. "protocol": "http:",
  638. "username": "",
  639. "password": "%3A%40c",
  640. "host": "d:2",
  641. "hostname": "d",
  642. "port": "2",
  643. "pathname": "/",
  644. "search": "",
  645. "hash": ""
  646. },
  647. {
  648. "input": "http://foo.com:b@d/",
  649. "base": "http://example.org/foo/bar",
  650. "href": "http://foo.com:b@d/",
  651. "origin": "http://d",
  652. "protocol": "http:",
  653. "username": "foo.com",
  654. "password": "b",
  655. "host": "d",
  656. "hostname": "d",
  657. "port": "",
  658. "pathname": "/",
  659. "search": "",
  660. "hash": ""
  661. },
  662. {
  663. "input": "http://foo.com/\\@",
  664. "base": "http://example.org/foo/bar",
  665. "href": "http://foo.com//@",
  666. "origin": "http://foo.com",
  667. "protocol": "http:",
  668. "username": "",
  669. "password": "",
  670. "host": "foo.com",
  671. "hostname": "foo.com",
  672. "port": "",
  673. "pathname": "//@",
  674. "search": "",
  675. "hash": ""
  676. },
  677. {
  678. "input": "http:\\\\foo.com\\",
  679. "base": "http://example.org/foo/bar",
  680. "href": "http://foo.com/",
  681. "origin": "http://foo.com",
  682. "protocol": "http:",
  683. "username": "",
  684. "password": "",
  685. "host": "foo.com",
  686. "hostname": "foo.com",
  687. "port": "",
  688. "pathname": "/",
  689. "search": "",
  690. "hash": ""
  691. },
  692. {
  693. "input": "http:\\\\a\\b:c\\d@foo.com\\",
  694. "base": "http://example.org/foo/bar",
  695. "href": "http://a/b:c/d@foo.com/",
  696. "origin": "http://a",
  697. "protocol": "http:",
  698. "username": "",
  699. "password": "",
  700. "host": "a",
  701. "hostname": "a",
  702. "port": "",
  703. "pathname": "/b:c/d@foo.com/",
  704. "search": "",
  705. "hash": ""
  706. },
  707. {
  708. "input": "foo:/",
  709. "base": "http://example.org/foo/bar",
  710. "href": "foo:/",
  711. "origin": "null",
  712. "protocol": "foo:",
  713. "username": "",
  714. "password": "",
  715. "host": "",
  716. "hostname": "",
  717. "port": "",
  718. "pathname": "/",
  719. "search": "",
  720. "hash": ""
  721. },
  722. {
  723. "input": "foo:/bar.com/",
  724. "base": "http://example.org/foo/bar",
  725. "href": "foo:/bar.com/",
  726. "origin": "null",
  727. "protocol": "foo:",
  728. "username": "",
  729. "password": "",
  730. "host": "",
  731. "hostname": "",
  732. "port": "",
  733. "pathname": "/bar.com/",
  734. "search": "",
  735. "hash": ""
  736. },
  737. {
  738. "input": "foo://///////",
  739. "base": "http://example.org/foo/bar",
  740. "href": "foo://///////",
  741. "origin": "null",
  742. "protocol": "foo:",
  743. "username": "",
  744. "password": "",
  745. "host": "",
  746. "hostname": "",
  747. "port": "",
  748. "pathname": "///////",
  749. "search": "",
  750. "hash": ""
  751. },
  752. {
  753. "input": "foo://///////bar.com/",
  754. "base": "http://example.org/foo/bar",
  755. "href": "foo://///////bar.com/",
  756. "origin": "null",
  757. "protocol": "foo:",
  758. "username": "",
  759. "password": "",
  760. "host": "",
  761. "hostname": "",
  762. "port": "",
  763. "pathname": "///////bar.com/",
  764. "search": "",
  765. "hash": ""
  766. },
  767. {
  768. "input": "foo:////://///",
  769. "base": "http://example.org/foo/bar",
  770. "href": "foo:////://///",
  771. "origin": "null",
  772. "protocol": "foo:",
  773. "username": "",
  774. "password": "",
  775. "host": "",
  776. "hostname": "",
  777. "port": "",
  778. "pathname": "//://///",
  779. "search": "",
  780. "hash": ""
  781. },
  782. {
  783. "input": "c:/foo",
  784. "base": "http://example.org/foo/bar",
  785. "href": "c:/foo",
  786. "origin": "null",
  787. "protocol": "c:",
  788. "username": "",
  789. "password": "",
  790. "host": "",
  791. "hostname": "",
  792. "port": "",
  793. "pathname": "/foo",
  794. "search": "",
  795. "hash": ""
  796. },
  797. {
  798. "input": "//foo/bar",
  799. "base": "http://example.org/foo/bar",
  800. "href": "http://foo/bar",
  801. "origin": "http://foo",
  802. "protocol": "http:",
  803. "username": "",
  804. "password": "",
  805. "host": "foo",
  806. "hostname": "foo",
  807. "port": "",
  808. "pathname": "/bar",
  809. "search": "",
  810. "hash": ""
  811. },
  812. {
  813. "input": "http://foo/path;a??e#f#g",
  814. "base": "http://example.org/foo/bar",
  815. "href": "http://foo/path;a??e#f#g",
  816. "origin": "http://foo",
  817. "protocol": "http:",
  818. "username": "",
  819. "password": "",
  820. "host": "foo",
  821. "hostname": "foo",
  822. "port": "",
  823. "pathname": "/path;a",
  824. "search": "??e",
  825. "hash": "#f#g"
  826. },
  827. {
  828. "input": "http://foo/abcd?efgh?ijkl",
  829. "base": "http://example.org/foo/bar",
  830. "href": "http://foo/abcd?efgh?ijkl",
  831. "origin": "http://foo",
  832. "protocol": "http:",
  833. "username": "",
  834. "password": "",
  835. "host": "foo",
  836. "hostname": "foo",
  837. "port": "",
  838. "pathname": "/abcd",
  839. "search": "?efgh?ijkl",
  840. "hash": ""
  841. },
  842. {
  843. "input": "http://foo/abcd#foo?bar",
  844. "base": "http://example.org/foo/bar",
  845. "href": "http://foo/abcd#foo?bar",
  846. "origin": "http://foo",
  847. "protocol": "http:",
  848. "username": "",
  849. "password": "",
  850. "host": "foo",
  851. "hostname": "foo",
  852. "port": "",
  853. "pathname": "/abcd",
  854. "search": "",
  855. "hash": "#foo?bar"
  856. },
  857. {
  858. "input": "[61:24:74]:98",
  859. "base": "http://example.org/foo/bar",
  860. "href": "http://example.org/foo/[61:24:74]:98",
  861. "origin": "http://example.org",
  862. "protocol": "http:",
  863. "username": "",
  864. "password": "",
  865. "host": "example.org",
  866. "hostname": "example.org",
  867. "port": "",
  868. "pathname": "/foo/[61:24:74]:98",
  869. "search": "",
  870. "hash": ""
  871. },
  872. {
  873. "input": "http:[61:27]/:foo",
  874. "base": "http://example.org/foo/bar",
  875. "href": "http://example.org/foo/[61:27]/:foo",
  876. "origin": "http://example.org",
  877. "protocol": "http:",
  878. "username": "",
  879. "password": "",
  880. "host": "example.org",
  881. "hostname": "example.org",
  882. "port": "",
  883. "pathname": "/foo/[61:27]/:foo",
  884. "search": "",
  885. "hash": ""
  886. },
  887. {
  888. "input": "http://[1::2]:3:4",
  889. "base": "http://example.org/foo/bar",
  890. "failure": true
  891. },
  892. {
  893. "input": "http://2001::1",
  894. "base": "http://example.org/foo/bar",
  895. "failure": true
  896. },
  897. {
  898. "input": "http://2001::1]",
  899. "base": "http://example.org/foo/bar",
  900. "failure": true
  901. },
  902. {
  903. "input": "http://2001::1]:80",
  904. "base": "http://example.org/foo/bar",
  905. "failure": true
  906. },
  907. {
  908. "input": "http://[2001::1]",
  909. "base": "http://example.org/foo/bar",
  910. "href": "http://[2001::1]/",
  911. "origin": "http://[2001::1]",
  912. "protocol": "http:",
  913. "username": "",
  914. "password": "",
  915. "host": "[2001::1]",
  916. "hostname": "[2001::1]",
  917. "port": "",
  918. "pathname": "/",
  919. "search": "",
  920. "hash": ""
  921. },
  922. {
  923. "input": "http://[::127.0.0.1]",
  924. "base": "http://example.org/foo/bar",
  925. "href": "http://[::7f00:1]/",
  926. "origin": "http://[::7f00:1]",
  927. "protocol": "http:",
  928. "username": "",
  929. "password": "",
  930. "host": "[::7f00:1]",
  931. "hostname": "[::7f00:1]",
  932. "port": "",
  933. "pathname": "/",
  934. "search": "",
  935. "hash": ""
  936. },
  937. {
  938. "input": "http://[0:0:0:0:0:0:13.1.68.3]",
  939. "base": "http://example.org/foo/bar",
  940. "href": "http://[::d01:4403]/",
  941. "origin": "http://[::d01:4403]",
  942. "protocol": "http:",
  943. "username": "",
  944. "password": "",
  945. "host": "[::d01:4403]",
  946. "hostname": "[::d01:4403]",
  947. "port": "",
  948. "pathname": "/",
  949. "search": "",
  950. "hash": ""
  951. },
  952. {
  953. "input": "http://[2001::1]:80",
  954. "base": "http://example.org/foo/bar",
  955. "href": "http://[2001::1]/",
  956. "origin": "http://[2001::1]",
  957. "protocol": "http:",
  958. "username": "",
  959. "password": "",
  960. "host": "[2001::1]",
  961. "hostname": "[2001::1]",
  962. "port": "",
  963. "pathname": "/",
  964. "search": "",
  965. "hash": ""
  966. },
  967. {
  968. "input": "http:/example.com/",
  969. "base": "http://example.org/foo/bar",
  970. "href": "http://example.org/example.com/",
  971. "origin": "http://example.org",
  972. "protocol": "http:",
  973. "username": "",
  974. "password": "",
  975. "host": "example.org",
  976. "hostname": "example.org",
  977. "port": "",
  978. "pathname": "/example.com/",
  979. "search": "",
  980. "hash": ""
  981. },
  982. {
  983. "input": "ftp:/example.com/",
  984. "base": "http://example.org/foo/bar",
  985. "href": "ftp://example.com/",
  986. "origin": "ftp://example.com",
  987. "protocol": "ftp:",
  988. "username": "",
  989. "password": "",
  990. "host": "example.com",
  991. "hostname": "example.com",
  992. "port": "",
  993. "pathname": "/",
  994. "search": "",
  995. "hash": ""
  996. },
  997. {
  998. "input": "https:/example.com/",
  999. "base": "http://example.org/foo/bar",
  1000. "href": "https://example.com/",
  1001. "origin": "https://example.com",
  1002. "protocol": "https:",
  1003. "username": "",
  1004. "password": "",
  1005. "host": "example.com",
  1006. "hostname": "example.com",
  1007. "port": "",
  1008. "pathname": "/",
  1009. "search": "",
  1010. "hash": ""
  1011. },
  1012. {
  1013. "input": "madeupscheme:/example.com/",
  1014. "base": "http://example.org/foo/bar",
  1015. "href": "madeupscheme:/example.com/",
  1016. "origin": "null",
  1017. "protocol": "madeupscheme:",
  1018. "username": "",
  1019. "password": "",
  1020. "host": "",
  1021. "hostname": "",
  1022. "port": "",
  1023. "pathname": "/example.com/",
  1024. "search": "",
  1025. "hash": ""
  1026. },
  1027. {
  1028. "input": "file:/example.com/",
  1029. "base": "http://example.org/foo/bar",
  1030. "href": "file:///example.com/",
  1031. "protocol": "file:",
  1032. "username": "",
  1033. "password": "",
  1034. "host": "",
  1035. "hostname": "",
  1036. "port": "",
  1037. "pathname": "/example.com/",
  1038. "search": "",
  1039. "hash": ""
  1040. },
  1041. {
  1042. "input": "file://example:1/",
  1043. "base": "about:blank",
  1044. "failure": true
  1045. },
  1046. {
  1047. "input": "file://example:test/",
  1048. "base": "about:blank",
  1049. "failure": true
  1050. },
  1051. {
  1052. "input": "file://example%/",
  1053. "base": "about:blank",
  1054. "failure": true
  1055. },
  1056. {
  1057. "input": "file://[example]/",
  1058. "base": "about:blank",
  1059. "failure": true
  1060. },
  1061. {
  1062. "input": "ftps:/example.com/",
  1063. "base": "http://example.org/foo/bar",
  1064. "href": "ftps:/example.com/",
  1065. "origin": "null",
  1066. "protocol": "ftps:",
  1067. "username": "",
  1068. "password": "",
  1069. "host": "",
  1070. "hostname": "",
  1071. "port": "",
  1072. "pathname": "/example.com/",
  1073. "search": "",
  1074. "hash": ""
  1075. },
  1076. {
  1077. "input": "gopher:/example.com/",
  1078. "base": "http://example.org/foo/bar",
  1079. "href": "gopher://example.com/",
  1080. "origin": "gopher://example.com",
  1081. "protocol": "gopher:",
  1082. "username": "",
  1083. "password": "",
  1084. "host": "example.com",
  1085. "hostname": "example.com",
  1086. "port": "",
  1087. "pathname": "/",
  1088. "search": "",
  1089. "hash": ""
  1090. },
  1091. {
  1092. "input": "ws:/example.com/",
  1093. "base": "http://example.org/foo/bar",
  1094. "href": "ws://example.com/",
  1095. "origin": "ws://example.com",
  1096. "protocol": "ws:",
  1097. "username": "",
  1098. "password": "",
  1099. "host": "example.com",
  1100. "hostname": "example.com",
  1101. "port": "",
  1102. "pathname": "/",
  1103. "search": "",
  1104. "hash": ""
  1105. },
  1106. {
  1107. "input": "wss:/example.com/",
  1108. "base": "http://example.org/foo/bar",
  1109. "href": "wss://example.com/",
  1110. "origin": "wss://example.com",
  1111. "protocol": "wss:",
  1112. "username": "",
  1113. "password": "",
  1114. "host": "example.com",
  1115. "hostname": "example.com",
  1116. "port": "",
  1117. "pathname": "/",
  1118. "search": "",
  1119. "hash": ""
  1120. },
  1121. {
  1122. "input": "data:/example.com/",
  1123. "base": "http://example.org/foo/bar",
  1124. "href": "data:/example.com/",
  1125. "origin": "null",
  1126. "protocol": "data:",
  1127. "username": "",
  1128. "password": "",
  1129. "host": "",
  1130. "hostname": "",
  1131. "port": "",
  1132. "pathname": "/example.com/",
  1133. "search": "",
  1134. "hash": ""
  1135. },
  1136. {
  1137. "input": "javascript:/example.com/",
  1138. "base": "http://example.org/foo/bar",
  1139. "href": "javascript:/example.com/",
  1140. "origin": "null",
  1141. "protocol": "javascript:",
  1142. "username": "",
  1143. "password": "",
  1144. "host": "",
  1145. "hostname": "",
  1146. "port": "",
  1147. "pathname": "/example.com/",
  1148. "search": "",
  1149. "hash": ""
  1150. },
  1151. {
  1152. "input": "mailto:/example.com/",
  1153. "base": "http://example.org/foo/bar",
  1154. "href": "mailto:/example.com/",
  1155. "origin": "null",
  1156. "protocol": "mailto:",
  1157. "username": "",
  1158. "password": "",
  1159. "host": "",
  1160. "hostname": "",
  1161. "port": "",
  1162. "pathname": "/example.com/",
  1163. "search": "",
  1164. "hash": ""
  1165. },
  1166. {
  1167. "input": "http:example.com/",
  1168. "base": "http://example.org/foo/bar",
  1169. "href": "http://example.org/foo/example.com/",
  1170. "origin": "http://example.org",
  1171. "protocol": "http:",
  1172. "username": "",
  1173. "password": "",
  1174. "host": "example.org",
  1175. "hostname": "example.org",
  1176. "port": "",
  1177. "pathname": "/foo/example.com/",
  1178. "search": "",
  1179. "hash": ""
  1180. },
  1181. {
  1182. "input": "ftp:example.com/",
  1183. "base": "http://example.org/foo/bar",
  1184. "href": "ftp://example.com/",
  1185. "origin": "ftp://example.com",
  1186. "protocol": "ftp:",
  1187. "username": "",
  1188. "password": "",
  1189. "host": "example.com",
  1190. "hostname": "example.com",
  1191. "port": "",
  1192. "pathname": "/",
  1193. "search": "",
  1194. "hash": ""
  1195. },
  1196. {
  1197. "input": "https:example.com/",
  1198. "base": "http://example.org/foo/bar",
  1199. "href": "https://example.com/",
  1200. "origin": "https://example.com",
  1201. "protocol": "https:",
  1202. "username": "",
  1203. "password": "",
  1204. "host": "example.com",
  1205. "hostname": "example.com",
  1206. "port": "",
  1207. "pathname": "/",
  1208. "search": "",
  1209. "hash": ""
  1210. },
  1211. {
  1212. "input": "madeupscheme:example.com/",
  1213. "base": "http://example.org/foo/bar",
  1214. "href": "madeupscheme:example.com/",
  1215. "origin": "null",
  1216. "protocol": "madeupscheme:",
  1217. "username": "",
  1218. "password": "",
  1219. "host": "",
  1220. "hostname": "",
  1221. "port": "",
  1222. "pathname": "example.com/",
  1223. "search": "",
  1224. "hash": ""
  1225. },
  1226. {
  1227. "input": "ftps:example.com/",
  1228. "base": "http://example.org/foo/bar",
  1229. "href": "ftps:example.com/",
  1230. "origin": "null",
  1231. "protocol": "ftps:",
  1232. "username": "",
  1233. "password": "",
  1234. "host": "",
  1235. "hostname": "",
  1236. "port": "",
  1237. "pathname": "example.com/",
  1238. "search": "",
  1239. "hash": ""
  1240. },
  1241. {
  1242. "input": "gopher:example.com/",
  1243. "base": "http://example.org/foo/bar",
  1244. "href": "gopher://example.com/",
  1245. "origin": "gopher://example.com",
  1246. "protocol": "gopher:",
  1247. "username": "",
  1248. "password": "",
  1249. "host": "example.com",
  1250. "hostname": "example.com",
  1251. "port": "",
  1252. "pathname": "/",
  1253. "search": "",
  1254. "hash": ""
  1255. },
  1256. {
  1257. "input": "ws:example.com/",
  1258. "base": "http://example.org/foo/bar",
  1259. "href": "ws://example.com/",
  1260. "origin": "ws://example.com",
  1261. "protocol": "ws:",
  1262. "username": "",
  1263. "password": "",
  1264. "host": "example.com",
  1265. "hostname": "example.com",
  1266. "port": "",
  1267. "pathname": "/",
  1268. "search": "",
  1269. "hash": ""
  1270. },
  1271. {
  1272. "input": "wss:example.com/",
  1273. "base": "http://example.org/foo/bar",
  1274. "href": "wss://example.com/",
  1275. "origin": "wss://example.com",
  1276. "protocol": "wss:",
  1277. "username": "",
  1278. "password": "",
  1279. "host": "example.com",
  1280. "hostname": "example.com",
  1281. "port": "",
  1282. "pathname": "/",
  1283. "search": "",
  1284. "hash": ""
  1285. },
  1286. {
  1287. "input": "data:example.com/",
  1288. "base": "http://example.org/foo/bar",
  1289. "href": "data:example.com/",
  1290. "origin": "null",
  1291. "protocol": "data:",
  1292. "username": "",
  1293. "password": "",
  1294. "host": "",
  1295. "hostname": "",
  1296. "port": "",
  1297. "pathname": "example.com/",
  1298. "search": "",
  1299. "hash": ""
  1300. },
  1301. {
  1302. "input": "javascript:example.com/",
  1303. "base": "http://example.org/foo/bar",
  1304. "href": "javascript:example.com/",
  1305. "origin": "null",
  1306. "protocol": "javascript:",
  1307. "username": "",
  1308. "password": "",
  1309. "host": "",
  1310. "hostname": "",
  1311. "port": "",
  1312. "pathname": "example.com/",
  1313. "search": "",
  1314. "hash": ""
  1315. },
  1316. {
  1317. "input": "mailto:example.com/",
  1318. "base": "http://example.org/foo/bar",
  1319. "href": "mailto:example.com/",
  1320. "origin": "null",
  1321. "protocol": "mailto:",
  1322. "username": "",
  1323. "password": "",
  1324. "host": "",
  1325. "hostname": "",
  1326. "port": "",
  1327. "pathname": "example.com/",
  1328. "search": "",
  1329. "hash": ""
  1330. },
  1331. {
  1332. "input": "/a/b/c",
  1333. "base": "http://example.org/foo/bar",
  1334. "href": "http://example.org/a/b/c",
  1335. "origin": "http://example.org",
  1336. "protocol": "http:",
  1337. "username": "",
  1338. "password": "",
  1339. "host": "example.org",
  1340. "hostname": "example.org",
  1341. "port": "",
  1342. "pathname": "/a/b/c",
  1343. "search": "",
  1344. "hash": ""
  1345. },
  1346. {
  1347. "input": "/a/ /c",
  1348. "base": "http://example.org/foo/bar",
  1349. "href": "http://example.org/a/%20/c",
  1350. "origin": "http://example.org",
  1351. "protocol": "http:",
  1352. "username": "",
  1353. "password": "",
  1354. "host": "example.org",
  1355. "hostname": "example.org",
  1356. "port": "",
  1357. "pathname": "/a/%20/c",
  1358. "search": "",
  1359. "hash": ""
  1360. },
  1361. {
  1362. "input": "/a%2fc",
  1363. "base": "http://example.org/foo/bar",
  1364. "href": "http://example.org/a%2fc",
  1365. "origin": "http://example.org",
  1366. "protocol": "http:",
  1367. "username": "",
  1368. "password": "",
  1369. "host": "example.org",
  1370. "hostname": "example.org",
  1371. "port": "",
  1372. "pathname": "/a%2fc",
  1373. "search": "",
  1374. "hash": ""
  1375. },
  1376. {
  1377. "input": "/a/%2f/c",
  1378. "base": "http://example.org/foo/bar",
  1379. "href": "http://example.org/a/%2f/c",
  1380. "origin": "http://example.org",
  1381. "protocol": "http:",
  1382. "username": "",
  1383. "password": "",
  1384. "host": "example.org",
  1385. "hostname": "example.org",
  1386. "port": "",
  1387. "pathname": "/a/%2f/c",
  1388. "search": "",
  1389. "hash": ""
  1390. },
  1391. {
  1392. "input": "#β",
  1393. "base": "http://example.org/foo/bar",
  1394. "href": "http://example.org/foo/bar#%CE%B2",
  1395. "origin": "http://example.org",
  1396. "protocol": "http:",
  1397. "username": "",
  1398. "password": "",
  1399. "host": "example.org",
  1400. "hostname": "example.org",
  1401. "port": "",
  1402. "pathname": "/foo/bar",
  1403. "search": "",
  1404. "hash": "#%CE%B2"
  1405. },
  1406. {
  1407. "input": "data:text/html,test#test",
  1408. "base": "http://example.org/foo/bar",
  1409. "href": "data:text/html,test#test",
  1410. "origin": "null",
  1411. "protocol": "data:",
  1412. "username": "",
  1413. "password": "",
  1414. "host": "",
  1415. "hostname": "",
  1416. "port": "",
  1417. "pathname": "text/html,test",
  1418. "search": "",
  1419. "hash": "#test"
  1420. },
  1421. {
  1422. "input": "tel:1234567890",
  1423. "base": "http://example.org/foo/bar",
  1424. "href": "tel:1234567890",
  1425. "origin": "null",
  1426. "protocol": "tel:",
  1427. "username": "",
  1428. "password": "",
  1429. "host": "",
  1430. "hostname": "",
  1431. "port": "",
  1432. "pathname": "1234567890",
  1433. "search": "",
  1434. "hash": ""
  1435. },
  1436. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
  1437. {
  1438. "input": "file:c:\\foo\\bar.html",
  1439. "base": "file:///tmp/mock/path",
  1440. "href": "file:///c:/foo/bar.html",
  1441. "protocol": "file:",
  1442. "username": "",
  1443. "password": "",
  1444. "host": "",
  1445. "hostname": "",
  1446. "port": "",
  1447. "pathname": "/c:/foo/bar.html",
  1448. "search": "",
  1449. "hash": ""
  1450. },
  1451. {
  1452. "input": " File:c|////foo\\bar.html",
  1453. "base": "file:///tmp/mock/path",
  1454. "href": "file:///c:////foo/bar.html",
  1455. "protocol": "file:",
  1456. "username": "",
  1457. "password": "",
  1458. "host": "",
  1459. "hostname": "",
  1460. "port": "",
  1461. "pathname": "/c:////foo/bar.html",
  1462. "search": "",
  1463. "hash": ""
  1464. },
  1465. {
  1466. "input": "C|/foo/bar",
  1467. "base": "file:///tmp/mock/path",
  1468. "href": "file:///C:/foo/bar",
  1469. "protocol": "file:",
  1470. "username": "",
  1471. "password": "",
  1472. "host": "",
  1473. "hostname": "",
  1474. "port": "",
  1475. "pathname": "/C:/foo/bar",
  1476. "search": "",
  1477. "hash": ""
  1478. },
  1479. {
  1480. "input": "/C|\\foo\\bar",
  1481. "base": "file:///tmp/mock/path",
  1482. "href": "file:///C:/foo/bar",
  1483. "protocol": "file:",
  1484. "username": "",
  1485. "password": "",
  1486. "host": "",
  1487. "hostname": "",
  1488. "port": "",
  1489. "pathname": "/C:/foo/bar",
  1490. "search": "",
  1491. "hash": ""
  1492. },
  1493. {
  1494. "input": "//C|/foo/bar",
  1495. "base": "file:///tmp/mock/path",
  1496. "href": "file:///C:/foo/bar",
  1497. "protocol": "file:",
  1498. "username": "",
  1499. "password": "",
  1500. "host": "",
  1501. "hostname": "",
  1502. "port": "",
  1503. "pathname": "/C:/foo/bar",
  1504. "search": "",
  1505. "hash": ""
  1506. },
  1507. {
  1508. "input": "//server/file",
  1509. "base": "file:///tmp/mock/path",
  1510. "href": "file://server/file",
  1511. "protocol": "file:",
  1512. "username": "",
  1513. "password": "",
  1514. "host": "server",
  1515. "hostname": "server",
  1516. "port": "",
  1517. "pathname": "/file",
  1518. "search": "",
  1519. "hash": ""
  1520. },
  1521. {
  1522. "input": "\\\\server\\file",
  1523. "base": "file:///tmp/mock/path",
  1524. "href": "file://server/file",
  1525. "protocol": "file:",
  1526. "username": "",
  1527. "password": "",
  1528. "host": "server",
  1529. "hostname": "server",
  1530. "port": "",
  1531. "pathname": "/file",
  1532. "search": "",
  1533. "hash": ""
  1534. },
  1535. {
  1536. "input": "/\\server/file",
  1537. "base": "file:///tmp/mock/path",
  1538. "href": "file://server/file",
  1539. "protocol": "file:",
  1540. "username": "",
  1541. "password": "",
  1542. "host": "server",
  1543. "hostname": "server",
  1544. "port": "",
  1545. "pathname": "/file",
  1546. "search": "",
  1547. "hash": ""
  1548. },
  1549. {
  1550. "input": "file:///foo/bar.txt",
  1551. "base": "file:///tmp/mock/path",
  1552. "href": "file:///foo/bar.txt",
  1553. "protocol": "file:",
  1554. "username": "",
  1555. "password": "",
  1556. "host": "",
  1557. "hostname": "",
  1558. "port": "",
  1559. "pathname": "/foo/bar.txt",
  1560. "search": "",
  1561. "hash": ""
  1562. },
  1563. {
  1564. "input": "file:///home/me",
  1565. "base": "file:///tmp/mock/path",
  1566. "href": "file:///home/me",
  1567. "protocol": "file:",
  1568. "username": "",
  1569. "password": "",
  1570. "host": "",
  1571. "hostname": "",
  1572. "port": "",
  1573. "pathname": "/home/me",
  1574. "search": "",
  1575. "hash": ""
  1576. },
  1577. {
  1578. "input": "//",
  1579. "base": "file:///tmp/mock/path",
  1580. "href": "file:///",
  1581. "protocol": "file:",
  1582. "username": "",
  1583. "password": "",
  1584. "host": "",
  1585. "hostname": "",
  1586. "port": "",
  1587. "pathname": "/",
  1588. "search": "",
  1589. "hash": ""
  1590. },
  1591. {
  1592. "input": "///",
  1593. "base": "file:///tmp/mock/path",
  1594. "href": "file:///",
  1595. "protocol": "file:",
  1596. "username": "",
  1597. "password": "",
  1598. "host": "",
  1599. "hostname": "",
  1600. "port": "",
  1601. "pathname": "/",
  1602. "search": "",
  1603. "hash": ""
  1604. },
  1605. {
  1606. "input": "///test",
  1607. "base": "file:///tmp/mock/path",
  1608. "href": "file:///test",
  1609. "protocol": "file:",
  1610. "username": "",
  1611. "password": "",
  1612. "host": "",
  1613. "hostname": "",
  1614. "port": "",
  1615. "pathname": "/test",
  1616. "search": "",
  1617. "hash": ""
  1618. },
  1619. {
  1620. "input": "file://test",
  1621. "base": "file:///tmp/mock/path",
  1622. "href": "file://test/",
  1623. "protocol": "file:",
  1624. "username": "",
  1625. "password": "",
  1626. "host": "test",
  1627. "hostname": "test",
  1628. "port": "",
  1629. "pathname": "/",
  1630. "search": "",
  1631. "hash": ""
  1632. },
  1633. {
  1634. "input": "file://localhost",
  1635. "base": "file:///tmp/mock/path",
  1636. "href": "file:///",
  1637. "protocol": "file:",
  1638. "username": "",
  1639. "password": "",
  1640. "host": "",
  1641. "hostname": "",
  1642. "port": "",
  1643. "pathname": "/",
  1644. "search": "",
  1645. "hash": ""
  1646. },
  1647. {
  1648. "input": "file://localhost/",
  1649. "base": "file:///tmp/mock/path",
  1650. "href": "file:///",
  1651. "protocol": "file:",
  1652. "username": "",
  1653. "password": "",
  1654. "host": "",
  1655. "hostname": "",
  1656. "port": "",
  1657. "pathname": "/",
  1658. "search": "",
  1659. "hash": ""
  1660. },
  1661. {
  1662. "input": "file://localhost/test",
  1663. "base": "file:///tmp/mock/path",
  1664. "href": "file:///test",
  1665. "protocol": "file:",
  1666. "username": "",
  1667. "password": "",
  1668. "host": "",
  1669. "hostname": "",
  1670. "port": "",
  1671. "pathname": "/test",
  1672. "search": "",
  1673. "hash": ""
  1674. },
  1675. {
  1676. "input": "test",
  1677. "base": "file:///tmp/mock/path",
  1678. "href": "file:///tmp/mock/test",
  1679. "protocol": "file:",
  1680. "username": "",
  1681. "password": "",
  1682. "host": "",
  1683. "hostname": "",
  1684. "port": "",
  1685. "pathname": "/tmp/mock/test",
  1686. "search": "",
  1687. "hash": ""
  1688. },
  1689. {
  1690. "input": "file:test",
  1691. "base": "file:///tmp/mock/path",
  1692. "href": "file:///tmp/mock/test",
  1693. "protocol": "file:",
  1694. "username": "",
  1695. "password": "",
  1696. "host": "",
  1697. "hostname": "",
  1698. "port": "",
  1699. "pathname": "/tmp/mock/test",
  1700. "search": "",
  1701. "hash": ""
  1702. },
  1703. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
  1704. {
  1705. "input": "http://example.com/././foo",
  1706. "base": "about:blank",
  1707. "href": "http://example.com/foo",
  1708. "origin": "http://example.com",
  1709. "protocol": "http:",
  1710. "username": "",
  1711. "password": "",
  1712. "host": "example.com",
  1713. "hostname": "example.com",
  1714. "port": "",
  1715. "pathname": "/foo",
  1716. "search": "",
  1717. "hash": ""
  1718. },
  1719. {
  1720. "input": "http://example.com/./.foo",
  1721. "base": "about:blank",
  1722. "href": "http://example.com/.foo",
  1723. "origin": "http://example.com",
  1724. "protocol": "http:",
  1725. "username": "",
  1726. "password": "",
  1727. "host": "example.com",
  1728. "hostname": "example.com",
  1729. "port": "",
  1730. "pathname": "/.foo",
  1731. "search": "",
  1732. "hash": ""
  1733. },
  1734. {
  1735. "input": "http://example.com/foo/.",
  1736. "base": "about:blank",
  1737. "href": "http://example.com/foo/",
  1738. "origin": "http://example.com",
  1739. "protocol": "http:",
  1740. "username": "",
  1741. "password": "",
  1742. "host": "example.com",
  1743. "hostname": "example.com",
  1744. "port": "",
  1745. "pathname": "/foo/",
  1746. "search": "",
  1747. "hash": ""
  1748. },
  1749. {
  1750. "input": "http://example.com/foo/./",
  1751. "base": "about:blank",
  1752. "href": "http://example.com/foo/",
  1753. "origin": "http://example.com",
  1754. "protocol": "http:",
  1755. "username": "",
  1756. "password": "",
  1757. "host": "example.com",
  1758. "hostname": "example.com",
  1759. "port": "",
  1760. "pathname": "/foo/",
  1761. "search": "",
  1762. "hash": ""
  1763. },
  1764. {
  1765. "input": "http://example.com/foo/bar/..",
  1766. "base": "about:blank",
  1767. "href": "http://example.com/foo/",
  1768. "origin": "http://example.com",
  1769. "protocol": "http:",
  1770. "username": "",
  1771. "password": "",
  1772. "host": "example.com",
  1773. "hostname": "example.com",
  1774. "port": "",
  1775. "pathname": "/foo/",
  1776. "search": "",
  1777. "hash": ""
  1778. },
  1779. {
  1780. "input": "http://example.com/foo/bar/../",
  1781. "base": "about:blank",
  1782. "href": "http://example.com/foo/",
  1783. "origin": "http://example.com",
  1784. "protocol": "http:",
  1785. "username": "",
  1786. "password": "",
  1787. "host": "example.com",
  1788. "hostname": "example.com",
  1789. "port": "",
  1790. "pathname": "/foo/",
  1791. "search": "",
  1792. "hash": ""
  1793. },
  1794. {
  1795. "input": "http://example.com/foo/..bar",
  1796. "base": "about:blank",
  1797. "href": "http://example.com/foo/..bar",
  1798. "origin": "http://example.com",
  1799. "protocol": "http:",
  1800. "username": "",
  1801. "password": "",
  1802. "host": "example.com",
  1803. "hostname": "example.com",
  1804. "port": "",
  1805. "pathname": "/foo/..bar",
  1806. "search": "",
  1807. "hash": ""
  1808. },
  1809. {
  1810. "input": "http://example.com/foo/bar/../ton",
  1811. "base": "about:blank",
  1812. "href": "http://example.com/foo/ton",
  1813. "origin": "http://example.com",
  1814. "protocol": "http:",
  1815. "username": "",
  1816. "password": "",
  1817. "host": "example.com",
  1818. "hostname": "example.com",
  1819. "port": "",
  1820. "pathname": "/foo/ton",
  1821. "search": "",
  1822. "hash": ""
  1823. },
  1824. {
  1825. "input": "http://example.com/foo/bar/../ton/../../a",
  1826. "base": "about:blank",
  1827. "href": "http://example.com/a",
  1828. "origin": "http://example.com",
  1829. "protocol": "http:",
  1830. "username": "",
  1831. "password": "",
  1832. "host": "example.com",
  1833. "hostname": "example.com",
  1834. "port": "",
  1835. "pathname": "/a",
  1836. "search": "",
  1837. "hash": ""
  1838. },
  1839. {
  1840. "input": "http://example.com/foo/../../..",
  1841. "base": "about:blank",
  1842. "href": "http://example.com/",
  1843. "origin": "http://example.com",
  1844. "protocol": "http:",
  1845. "username": "",
  1846. "password": "",
  1847. "host": "example.com",
  1848. "hostname": "example.com",
  1849. "port": "",
  1850. "pathname": "/",
  1851. "search": "",
  1852. "hash": ""
  1853. },
  1854. {
  1855. "input": "http://example.com/foo/../../../ton",
  1856. "base": "about:blank",
  1857. "href": "http://example.com/ton",
  1858. "origin": "http://example.com",
  1859. "protocol": "http:",
  1860. "username": "",
  1861. "password": "",
  1862. "host": "example.com",
  1863. "hostname": "example.com",
  1864. "port": "",
  1865. "pathname": "/ton",
  1866. "search": "",
  1867. "hash": ""
  1868. },
  1869. {
  1870. "input": "http://example.com/foo/%2e",
  1871. "base": "about:blank",
  1872. "href": "http://example.com/foo/",
  1873. "origin": "http://example.com",
  1874. "protocol": "http:",
  1875. "username": "",
  1876. "password": "",
  1877. "host": "example.com",
  1878. "hostname": "example.com",
  1879. "port": "",
  1880. "pathname": "/foo/",
  1881. "search": "",
  1882. "hash": ""
  1883. },
  1884. {
  1885. "input": "http://example.com/foo/%2e%2",
  1886. "base": "about:blank",
  1887. "href": "http://example.com/foo/%2e%2",
  1888. "origin": "http://example.com",
  1889. "protocol": "http:",
  1890. "username": "",
  1891. "password": "",
  1892. "host": "example.com",
  1893. "hostname": "example.com",
  1894. "port": "",
  1895. "pathname": "/foo/%2e%2",
  1896. "search": "",
  1897. "hash": ""
  1898. },
  1899. {
  1900. "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
  1901. "base": "about:blank",
  1902. "href": "http://example.com/%2e.bar",
  1903. "origin": "http://example.com",
  1904. "protocol": "http:",
  1905. "username": "",
  1906. "password": "",
  1907. "host": "example.com",
  1908. "hostname": "example.com",
  1909. "port": "",
  1910. "pathname": "/%2e.bar",
  1911. "search": "",
  1912. "hash": ""
  1913. },
  1914. {
  1915. "input": "http://example.com////../..",
  1916. "base": "about:blank",
  1917. "href": "http://example.com//",
  1918. "origin": "http://example.com",
  1919. "protocol": "http:",
  1920. "username": "",
  1921. "password": "",
  1922. "host": "example.com",
  1923. "hostname": "example.com",
  1924. "port": "",
  1925. "pathname": "//",
  1926. "search": "",
  1927. "hash": ""
  1928. },
  1929. {
  1930. "input": "http://example.com/foo/bar//../..",
  1931. "base": "about:blank",
  1932. "href": "http://example.com/foo/",
  1933. "origin": "http://example.com",
  1934. "protocol": "http:",
  1935. "username": "",
  1936. "password": "",
  1937. "host": "example.com",
  1938. "hostname": "example.com",
  1939. "port": "",
  1940. "pathname": "/foo/",
  1941. "search": "",
  1942. "hash": ""
  1943. },
  1944. {
  1945. "input": "http://example.com/foo/bar//..",
  1946. "base": "about:blank",
  1947. "href": "http://example.com/foo/bar/",
  1948. "origin": "http://example.com",
  1949. "protocol": "http:",
  1950. "username": "",
  1951. "password": "",
  1952. "host": "example.com",
  1953. "hostname": "example.com",
  1954. "port": "",
  1955. "pathname": "/foo/bar/",
  1956. "search": "",
  1957. "hash": ""
  1958. },
  1959. {
  1960. "input": "http://example.com/foo",
  1961. "base": "about:blank",
  1962. "href": "http://example.com/foo",
  1963. "origin": "http://example.com",
  1964. "protocol": "http:",
  1965. "username": "",
  1966. "password": "",
  1967. "host": "example.com",
  1968. "hostname": "example.com",
  1969. "port": "",
  1970. "pathname": "/foo",
  1971. "search": "",
  1972. "hash": ""
  1973. },
  1974. {
  1975. "input": "http://example.com/%20foo",
  1976. "base": "about:blank",
  1977. "href": "http://example.com/%20foo",
  1978. "origin": "http://example.com",
  1979. "protocol": "http:",
  1980. "username": "",
  1981. "password": "",
  1982. "host": "example.com",
  1983. "hostname": "example.com",
  1984. "port": "",
  1985. "pathname": "/%20foo",
  1986. "search": "",
  1987. "hash": ""
  1988. },
  1989. {
  1990. "input": "http://example.com/foo%",
  1991. "base": "about:blank",
  1992. "href": "http://example.com/foo%",
  1993. "origin": "http://example.com",
  1994. "protocol": "http:",
  1995. "username": "",
  1996. "password": "",
  1997. "host": "example.com",
  1998. "hostname": "example.com",
  1999. "port": "",
  2000. "pathname": "/foo%",
  2001. "search": "",
  2002. "hash": ""
  2003. },
  2004. {
  2005. "input": "http://example.com/foo%2",
  2006. "base": "about:blank",
  2007. "href": "http://example.com/foo%2",
  2008. "origin": "http://example.com",
  2009. "protocol": "http:",
  2010. "username": "",
  2011. "password": "",
  2012. "host": "example.com",
  2013. "hostname": "example.com",
  2014. "port": "",
  2015. "pathname": "/foo%2",
  2016. "search": "",
  2017. "hash": ""
  2018. },
  2019. {
  2020. "input": "http://example.com/foo%2zbar",
  2021. "base": "about:blank",
  2022. "href": "http://example.com/foo%2zbar",
  2023. "origin": "http://example.com",
  2024. "protocol": "http:",
  2025. "username": "",
  2026. "password": "",
  2027. "host": "example.com",
  2028. "hostname": "example.com",
  2029. "port": "",
  2030. "pathname": "/foo%2zbar",
  2031. "search": "",
  2032. "hash": ""
  2033. },
  2034. {
  2035. "input": "http://example.com/foo%2©zbar",
  2036. "base": "about:blank",
  2037. "href": "http://example.com/foo%2%C3%82%C2%A9zbar",
  2038. "origin": "http://example.com",
  2039. "protocol": "http:",
  2040. "username": "",
  2041. "password": "",
  2042. "host": "example.com",
  2043. "hostname": "example.com",
  2044. "port": "",
  2045. "pathname": "/foo%2%C3%82%C2%A9zbar",
  2046. "search": "",
  2047. "hash": ""
  2048. },
  2049. {
  2050. "input": "http://example.com/foo%41%7a",
  2051. "base": "about:blank",
  2052. "href": "http://example.com/foo%41%7a",
  2053. "origin": "http://example.com",
  2054. "protocol": "http:",
  2055. "username": "",
  2056. "password": "",
  2057. "host": "example.com",
  2058. "hostname": "example.com",
  2059. "port": "",
  2060. "pathname": "/foo%41%7a",
  2061. "search": "",
  2062. "hash": ""
  2063. },
  2064. {
  2065. "input": "http://example.com/foo\t\u0091%91",
  2066. "base": "about:blank",
  2067. "href": "http://example.com/foo%C2%91%91",
  2068. "origin": "http://example.com",
  2069. "protocol": "http:",
  2070. "username": "",
  2071. "password": "",
  2072. "host": "example.com",
  2073. "hostname": "example.com",
  2074. "port": "",
  2075. "pathname": "/foo%C2%91%91",
  2076. "search": "",
  2077. "hash": ""
  2078. },
  2079. {
  2080. "input": "http://example.com/foo%00%51",
  2081. "base": "about:blank",
  2082. "href": "http://example.com/foo%00%51",
  2083. "origin": "http://example.com",
  2084. "protocol": "http:",
  2085. "username": "",
  2086. "password": "",
  2087. "host": "example.com",
  2088. "hostname": "example.com",
  2089. "port": "",
  2090. "pathname": "/foo%00%51",
  2091. "search": "",
  2092. "hash": ""
  2093. },
  2094. {
  2095. "input": "http://example.com/(%28:%3A%29)",
  2096. "base": "about:blank",
  2097. "href": "http://example.com/(%28:%3A%29)",
  2098. "origin": "http://example.com",
  2099. "protocol": "http:",
  2100. "username": "",
  2101. "password": "",
  2102. "host": "example.com",
  2103. "hostname": "example.com",
  2104. "port": "",
  2105. "pathname": "/(%28:%3A%29)",
  2106. "search": "",
  2107. "hash": ""
  2108. },
  2109. {
  2110. "input": "http://example.com/%3A%3a%3C%3c",
  2111. "base": "about:blank",
  2112. "href": "http://example.com/%3A%3a%3C%3c",
  2113. "origin": "http://example.com",
  2114. "protocol": "http:",
  2115. "username": "",
  2116. "password": "",
  2117. "host": "example.com",
  2118. "hostname": "example.com",
  2119. "port": "",
  2120. "pathname": "/%3A%3a%3C%3c",
  2121. "search": "",
  2122. "hash": ""
  2123. },
  2124. {
  2125. "input": "http://example.com/foo\tbar",
  2126. "base": "about:blank",
  2127. "href": "http://example.com/foobar",
  2128. "origin": "http://example.com",
  2129. "protocol": "http:",
  2130. "username": "",
  2131. "password": "",
  2132. "host": "example.com",
  2133. "hostname": "example.com",
  2134. "port": "",
  2135. "pathname": "/foobar",
  2136. "search": "",
  2137. "hash": ""
  2138. },
  2139. {
  2140. "input": "http://example.com\\\\foo\\\\bar",
  2141. "base": "about:blank",
  2142. "href": "http://example.com//foo//bar",
  2143. "origin": "http://example.com",
  2144. "protocol": "http:",
  2145. "username": "",
  2146. "password": "",
  2147. "host": "example.com",
  2148. "hostname": "example.com",
  2149. "port": "",
  2150. "pathname": "//foo//bar",
  2151. "search": "",
  2152. "hash": ""
  2153. },
  2154. {
  2155. "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2156. "base": "about:blank",
  2157. "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2158. "origin": "http://example.com",
  2159. "protocol": "http:",
  2160. "username": "",
  2161. "password": "",
  2162. "host": "example.com",
  2163. "hostname": "example.com",
  2164. "port": "",
  2165. "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2166. "search": "",
  2167. "hash": ""
  2168. },
  2169. {
  2170. "input": "http://example.com/@asdf%40",
  2171. "base": "about:blank",
  2172. "href": "http://example.com/@asdf%40",
  2173. "origin": "http://example.com",
  2174. "protocol": "http:",
  2175. "username": "",
  2176. "password": "",
  2177. "host": "example.com",
  2178. "hostname": "example.com",
  2179. "port": "",
  2180. "pathname": "/@asdf%40",
  2181. "search": "",
  2182. "hash": ""
  2183. },
  2184. {
  2185. "input": "http://example.com/你好你好",
  2186. "base": "about:blank",
  2187. "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2188. "origin": "http://example.com",
  2189. "protocol": "http:",
  2190. "username": "",
  2191. "password": "",
  2192. "host": "example.com",
  2193. "hostname": "example.com",
  2194. "port": "",
  2195. "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2196. "search": "",
  2197. "hash": ""
  2198. },
  2199. {
  2200. "input": "http://example.com/‥/foo",
  2201. "base": "about:blank",
  2202. "href": "http://example.com/%E2%80%A5/foo",
  2203. "origin": "http://example.com",
  2204. "protocol": "http:",
  2205. "username": "",
  2206. "password": "",
  2207. "host": "example.com",
  2208. "hostname": "example.com",
  2209. "port": "",
  2210. "pathname": "/%E2%80%A5/foo",
  2211. "search": "",
  2212. "hash": ""
  2213. },
  2214. {
  2215. "input": "http://example.com//foo",
  2216. "base": "about:blank",
  2217. "href": "http://example.com/%EF%BB%BF/foo",
  2218. "origin": "http://example.com",
  2219. "protocol": "http:",
  2220. "username": "",
  2221. "password": "",
  2222. "host": "example.com",
  2223. "hostname": "example.com",
  2224. "port": "",
  2225. "pathname": "/%EF%BB%BF/foo",
  2226. "search": "",
  2227. "hash": ""
  2228. },
  2229. {
  2230. "input": "http://example.com/‮/foo/‭/bar",
  2231. "base": "about:blank",
  2232. "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar",
  2233. "origin": "http://example.com",
  2234. "protocol": "http:",
  2235. "username": "",
  2236. "password": "",
  2237. "host": "example.com",
  2238. "hostname": "example.com",
  2239. "port": "",
  2240. "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
  2241. "search": "",
  2242. "hash": ""
  2243. },
  2244. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js",
  2245. {
  2246. "input": "http://www.google.com/foo?bar=baz#",
  2247. "base": "about:blank",
  2248. "href": "http://www.google.com/foo?bar=baz#",
  2249. "origin": "http://www.google.com",
  2250. "protocol": "http:",
  2251. "username": "",
  2252. "password": "",
  2253. "host": "www.google.com",
  2254. "hostname": "www.google.com",
  2255. "port": "",
  2256. "pathname": "/foo",
  2257. "search": "?bar=baz",
  2258. "hash": ""
  2259. },
  2260. {
  2261. "input": "http://www.google.com/foo?bar=baz# »",
  2262. "base": "about:blank",
  2263. "href": "http://www.google.com/foo?bar=baz# %C2%BB",
  2264. "origin": "http://www.google.com",
  2265. "protocol": "http:",
  2266. "username": "",
  2267. "password": "",
  2268. "host": "www.google.com",
  2269. "hostname": "www.google.com",
  2270. "port": "",
  2271. "pathname": "/foo",
  2272. "search": "?bar=baz",
  2273. "hash": "# %C2%BB"
  2274. },
  2275. {
  2276. "input": "data:test# »",
  2277. "base": "about:blank",
  2278. "href": "data:test# %C2%BB",
  2279. "origin": "null",
  2280. "protocol": "data:",
  2281. "username": "",
  2282. "password": "",
  2283. "host": "",
  2284. "hostname": "",
  2285. "port": "",
  2286. "pathname": "test",
  2287. "search": "",
  2288. "hash": "# %C2%BB"
  2289. },
  2290. {
  2291. "input": "http://www.google.com",
  2292. "base": "about:blank",
  2293. "href": "http://www.google.com/",
  2294. "origin": "http://www.google.com",
  2295. "protocol": "http:",
  2296. "username": "",
  2297. "password": "",
  2298. "host": "www.google.com",
  2299. "hostname": "www.google.com",
  2300. "port": "",
  2301. "pathname": "/",
  2302. "search": "",
  2303. "hash": ""
  2304. },
  2305. {
  2306. "input": "http://192.0x00A80001",
  2307. "base": "about:blank",
  2308. "href": "http://192.168.0.1/",
  2309. "origin": "http://192.168.0.1",
  2310. "protocol": "http:",
  2311. "username": "",
  2312. "password": "",
  2313. "host": "192.168.0.1",
  2314. "hostname": "192.168.0.1",
  2315. "port": "",
  2316. "pathname": "/",
  2317. "search": "",
  2318. "hash": ""
  2319. },
  2320. {
  2321. "input": "http://www/foo%2Ehtml",
  2322. "base": "about:blank",
  2323. "href": "http://www/foo%2Ehtml",
  2324. "origin": "http://www",
  2325. "protocol": "http:",
  2326. "username": "",
  2327. "password": "",
  2328. "host": "www",
  2329. "hostname": "www",
  2330. "port": "",
  2331. "pathname": "/foo%2Ehtml",
  2332. "search": "",
  2333. "hash": ""
  2334. },
  2335. {
  2336. "input": "http://www/foo/%2E/html",
  2337. "base": "about:blank",
  2338. "href": "http://www/foo/html",
  2339. "origin": "http://www",
  2340. "protocol": "http:",
  2341. "username": "",
  2342. "password": "",
  2343. "host": "www",
  2344. "hostname": "www",
  2345. "port": "",
  2346. "pathname": "/foo/html",
  2347. "search": "",
  2348. "hash": ""
  2349. },
  2350. {
  2351. "input": "http://user:pass@/",
  2352. "base": "about:blank",
  2353. "failure": true
  2354. },
  2355. {
  2356. "input": "http://%25DOMAIN:foobar@foodomain.com/",
  2357. "base": "about:blank",
  2358. "href": "http://%25DOMAIN:foobar@foodomain.com/",
  2359. "origin": "http://foodomain.com",
  2360. "protocol": "http:",
  2361. "username": "%25DOMAIN",
  2362. "password": "foobar",
  2363. "host": "foodomain.com",
  2364. "hostname": "foodomain.com",
  2365. "port": "",
  2366. "pathname": "/",
  2367. "search": "",
  2368. "hash": ""
  2369. },
  2370. {
  2371. "input": "http:\\\\www.google.com\\foo",
  2372. "base": "about:blank",
  2373. "href": "http://www.google.com/foo",
  2374. "origin": "http://www.google.com",
  2375. "protocol": "http:",
  2376. "username": "",
  2377. "password": "",
  2378. "host": "www.google.com",
  2379. "hostname": "www.google.com",
  2380. "port": "",
  2381. "pathname": "/foo",
  2382. "search": "",
  2383. "hash": ""
  2384. },
  2385. {
  2386. "input": "http://foo:80/",
  2387. "base": "about:blank",
  2388. "href": "http://foo/",
  2389. "origin": "http://foo",
  2390. "protocol": "http:",
  2391. "username": "",
  2392. "password": "",
  2393. "host": "foo",
  2394. "hostname": "foo",
  2395. "port": "",
  2396. "pathname": "/",
  2397. "search": "",
  2398. "hash": ""
  2399. },
  2400. {
  2401. "input": "http://foo:81/",
  2402. "base": "about:blank",
  2403. "href": "http://foo:81/",
  2404. "origin": "http://foo:81",
  2405. "protocol": "http:",
  2406. "username": "",
  2407. "password": "",
  2408. "host": "foo:81",
  2409. "hostname": "foo",
  2410. "port": "81",
  2411. "pathname": "/",
  2412. "search": "",
  2413. "hash": ""
  2414. },
  2415. {
  2416. "input": "httpa://foo:80/",
  2417. "base": "about:blank",
  2418. "href": "httpa://foo:80/",
  2419. "origin": "null",
  2420. "protocol": "httpa:",
  2421. "username": "",
  2422. "password": "",
  2423. "host": "foo:80",
  2424. "hostname": "foo",
  2425. "port": "80",
  2426. "pathname": "/",
  2427. "search": "",
  2428. "hash": ""
  2429. },
  2430. {
  2431. "input": "http://foo:-80/",
  2432. "base": "about:blank",
  2433. "failure": true
  2434. },
  2435. {
  2436. "input": "https://foo:443/",
  2437. "base": "about:blank",
  2438. "href": "https://foo/",
  2439. "origin": "https://foo",
  2440. "protocol": "https:",
  2441. "username": "",
  2442. "password": "",
  2443. "host": "foo",
  2444. "hostname": "foo",
  2445. "port": "",
  2446. "pathname": "/",
  2447. "search": "",
  2448. "hash": ""
  2449. },
  2450. {
  2451. "input": "https://foo:80/",
  2452. "base": "about:blank",
  2453. "href": "https://foo:80/",
  2454. "origin": "https://foo:80",
  2455. "protocol": "https:",
  2456. "username": "",
  2457. "password": "",
  2458. "host": "foo:80",
  2459. "hostname": "foo",
  2460. "port": "80",
  2461. "pathname": "/",
  2462. "search": "",
  2463. "hash": ""
  2464. },
  2465. {
  2466. "input": "ftp://foo:21/",
  2467. "base": "about:blank",
  2468. "href": "ftp://foo/",
  2469. "origin": "ftp://foo",
  2470. "protocol": "ftp:",
  2471. "username": "",
  2472. "password": "",
  2473. "host": "foo",
  2474. "hostname": "foo",
  2475. "port": "",
  2476. "pathname": "/",
  2477. "search": "",
  2478. "hash": ""
  2479. },
  2480. {
  2481. "input": "ftp://foo:80/",
  2482. "base": "about:blank",
  2483. "href": "ftp://foo:80/",
  2484. "origin": "ftp://foo:80",
  2485. "protocol": "ftp:",
  2486. "username": "",
  2487. "password": "",
  2488. "host": "foo:80",
  2489. "hostname": "foo",
  2490. "port": "80",
  2491. "pathname": "/",
  2492. "search": "",
  2493. "hash": ""
  2494. },
  2495. {
  2496. "input": "gopher://foo:70/",
  2497. "base": "about:blank",
  2498. "href": "gopher://foo/",
  2499. "origin": "gopher://foo",
  2500. "protocol": "gopher:",
  2501. "username": "",
  2502. "password": "",
  2503. "host": "foo",
  2504. "hostname": "foo",
  2505. "port": "",
  2506. "pathname": "/",
  2507. "search": "",
  2508. "hash": ""
  2509. },
  2510. {
  2511. "input": "gopher://foo:443/",
  2512. "base": "about:blank",
  2513. "href": "gopher://foo:443/",
  2514. "origin": "gopher://foo:443",
  2515. "protocol": "gopher:",
  2516. "username": "",
  2517. "password": "",
  2518. "host": "foo:443",
  2519. "hostname": "foo",
  2520. "port": "443",
  2521. "pathname": "/",
  2522. "search": "",
  2523. "hash": ""
  2524. },
  2525. {
  2526. "input": "ws://foo:80/",
  2527. "base": "about:blank",
  2528. "href": "ws://foo/",
  2529. "origin": "ws://foo",
  2530. "protocol": "ws:",
  2531. "username": "",
  2532. "password": "",
  2533. "host": "foo",
  2534. "hostname": "foo",
  2535. "port": "",
  2536. "pathname": "/",
  2537. "search": "",
  2538. "hash": ""
  2539. },
  2540. {
  2541. "input": "ws://foo:81/",
  2542. "base": "about:blank",
  2543. "href": "ws://foo:81/",
  2544. "origin": "ws://foo:81",
  2545. "protocol": "ws:",
  2546. "username": "",
  2547. "password": "",
  2548. "host": "foo:81",
  2549. "hostname": "foo",
  2550. "port": "81",
  2551. "pathname": "/",
  2552. "search": "",
  2553. "hash": ""
  2554. },
  2555. {
  2556. "input": "ws://foo:443/",
  2557. "base": "about:blank",
  2558. "href": "ws://foo:443/",
  2559. "origin": "ws://foo:443",
  2560. "protocol": "ws:",
  2561. "username": "",
  2562. "password": "",
  2563. "host": "foo:443",
  2564. "hostname": "foo",
  2565. "port": "443",
  2566. "pathname": "/",
  2567. "search": "",
  2568. "hash": ""
  2569. },
  2570. {
  2571. "input": "ws://foo:815/",
  2572. "base": "about:blank",
  2573. "href": "ws://foo:815/",
  2574. "origin": "ws://foo:815",
  2575. "protocol": "ws:",
  2576. "username": "",
  2577. "password": "",
  2578. "host": "foo:815",
  2579. "hostname": "foo",
  2580. "port": "815",
  2581. "pathname": "/",
  2582. "search": "",
  2583. "hash": ""
  2584. },
  2585. {
  2586. "input": "wss://foo:80/",
  2587. "base": "about:blank",
  2588. "href": "wss://foo:80/",
  2589. "origin": "wss://foo:80",
  2590. "protocol": "wss:",
  2591. "username": "",
  2592. "password": "",
  2593. "host": "foo:80",
  2594. "hostname": "foo",
  2595. "port": "80",
  2596. "pathname": "/",
  2597. "search": "",
  2598. "hash": ""
  2599. },
  2600. {
  2601. "input": "wss://foo:81/",
  2602. "base": "about:blank",
  2603. "href": "wss://foo:81/",
  2604. "origin": "wss://foo:81",
  2605. "protocol": "wss:",
  2606. "username": "",
  2607. "password": "",
  2608. "host": "foo:81",
  2609. "hostname": "foo",
  2610. "port": "81",
  2611. "pathname": "/",
  2612. "search": "",
  2613. "hash": ""
  2614. },
  2615. {
  2616. "input": "wss://foo:443/",
  2617. "base": "about:blank",
  2618. "href": "wss://foo/",
  2619. "origin": "wss://foo",
  2620. "protocol": "wss:",
  2621. "username": "",
  2622. "password": "",
  2623. "host": "foo",
  2624. "hostname": "foo",
  2625. "port": "",
  2626. "pathname": "/",
  2627. "search": "",
  2628. "hash": ""
  2629. },
  2630. {
  2631. "input": "wss://foo:815/",
  2632. "base": "about:blank",
  2633. "href": "wss://foo:815/",
  2634. "origin": "wss://foo:815",
  2635. "protocol": "wss:",
  2636. "username": "",
  2637. "password": "",
  2638. "host": "foo:815",
  2639. "hostname": "foo",
  2640. "port": "815",
  2641. "pathname": "/",
  2642. "search": "",
  2643. "hash": ""
  2644. },
  2645. {
  2646. "input": "http:/example.com/",
  2647. "base": "about:blank",
  2648. "href": "http://example.com/",
  2649. "origin": "http://example.com",
  2650. "protocol": "http:",
  2651. "username": "",
  2652. "password": "",
  2653. "host": "example.com",
  2654. "hostname": "example.com",
  2655. "port": "",
  2656. "pathname": "/",
  2657. "search": "",
  2658. "hash": ""
  2659. },
  2660. {
  2661. "input": "ftp:/example.com/",
  2662. "base": "about:blank",
  2663. "href": "ftp://example.com/",
  2664. "origin": "ftp://example.com",
  2665. "protocol": "ftp:",
  2666. "username": "",
  2667. "password": "",
  2668. "host": "example.com",
  2669. "hostname": "example.com",
  2670. "port": "",
  2671. "pathname": "/",
  2672. "search": "",
  2673. "hash": ""
  2674. },
  2675. {
  2676. "input": "https:/example.com/",
  2677. "base": "about:blank",
  2678. "href": "https://example.com/",
  2679. "origin": "https://example.com",
  2680. "protocol": "https:",
  2681. "username": "",
  2682. "password": "",
  2683. "host": "example.com",
  2684. "hostname": "example.com",
  2685. "port": "",
  2686. "pathname": "/",
  2687. "search": "",
  2688. "hash": ""
  2689. },
  2690. {
  2691. "input": "madeupscheme:/example.com/",
  2692. "base": "about:blank",
  2693. "href": "madeupscheme:/example.com/",
  2694. "origin": "null",
  2695. "protocol": "madeupscheme:",
  2696. "username": "",
  2697. "password": "",
  2698. "host": "",
  2699. "hostname": "",
  2700. "port": "",
  2701. "pathname": "/example.com/",
  2702. "search": "",
  2703. "hash": ""
  2704. },
  2705. {
  2706. "input": "file:/example.com/",
  2707. "base": "about:blank",
  2708. "href": "file:///example.com/",
  2709. "protocol": "file:",
  2710. "username": "",
  2711. "password": "",
  2712. "host": "",
  2713. "hostname": "",
  2714. "port": "",
  2715. "pathname": "/example.com/",
  2716. "search": "",
  2717. "hash": ""
  2718. },
  2719. {
  2720. "input": "ftps:/example.com/",
  2721. "base": "about:blank",
  2722. "href": "ftps:/example.com/",
  2723. "origin": "null",
  2724. "protocol": "ftps:",
  2725. "username": "",
  2726. "password": "",
  2727. "host": "",
  2728. "hostname": "",
  2729. "port": "",
  2730. "pathname": "/example.com/",
  2731. "search": "",
  2732. "hash": ""
  2733. },
  2734. {
  2735. "input": "gopher:/example.com/",
  2736. "base": "about:blank",
  2737. "href": "gopher://example.com/",
  2738. "origin": "gopher://example.com",
  2739. "protocol": "gopher:",
  2740. "username": "",
  2741. "password": "",
  2742. "host": "example.com",
  2743. "hostname": "example.com",
  2744. "port": "",
  2745. "pathname": "/",
  2746. "search": "",
  2747. "hash": ""
  2748. },
  2749. {
  2750. "input": "ws:/example.com/",
  2751. "base": "about:blank",
  2752. "href": "ws://example.com/",
  2753. "origin": "ws://example.com",
  2754. "protocol": "ws:",
  2755. "username": "",
  2756. "password": "",
  2757. "host": "example.com",
  2758. "hostname": "example.com",
  2759. "port": "",
  2760. "pathname": "/",
  2761. "search": "",
  2762. "hash": ""
  2763. },
  2764. {
  2765. "input": "wss:/example.com/",
  2766. "base": "about:blank",
  2767. "href": "wss://example.com/",
  2768. "origin": "wss://example.com",
  2769. "protocol": "wss:",
  2770. "username": "",
  2771. "password": "",
  2772. "host": "example.com",
  2773. "hostname": "example.com",
  2774. "port": "",
  2775. "pathname": "/",
  2776. "search": "",
  2777. "hash": ""
  2778. },
  2779. {
  2780. "input": "data:/example.com/",
  2781. "base": "about:blank",
  2782. "href": "data:/example.com/",
  2783. "origin": "null",
  2784. "protocol": "data:",
  2785. "username": "",
  2786. "password": "",
  2787. "host": "",
  2788. "hostname": "",
  2789. "port": "",
  2790. "pathname": "/example.com/",
  2791. "search": "",
  2792. "hash": ""
  2793. },
  2794. {
  2795. "input": "javascript:/example.com/",
  2796. "base": "about:blank",
  2797. "href": "javascript:/example.com/",
  2798. "origin": "null",
  2799. "protocol": "javascript:",
  2800. "username": "",
  2801. "password": "",
  2802. "host": "",
  2803. "hostname": "",
  2804. "port": "",
  2805. "pathname": "/example.com/",
  2806. "search": "",
  2807. "hash": ""
  2808. },
  2809. {
  2810. "input": "mailto:/example.com/",
  2811. "base": "about:blank",
  2812. "href": "mailto:/example.com/",
  2813. "origin": "null",
  2814. "protocol": "mailto:",
  2815. "username": "",
  2816. "password": "",
  2817. "host": "",
  2818. "hostname": "",
  2819. "port": "",
  2820. "pathname": "/example.com/",
  2821. "search": "",
  2822. "hash": ""
  2823. },
  2824. {
  2825. "input": "http:example.com/",
  2826. "base": "about:blank",
  2827. "href": "http://example.com/",
  2828. "origin": "http://example.com",
  2829. "protocol": "http:",
  2830. "username": "",
  2831. "password": "",
  2832. "host": "example.com",
  2833. "hostname": "example.com",
  2834. "port": "",
  2835. "pathname": "/",
  2836. "search": "",
  2837. "hash": ""
  2838. },
  2839. {
  2840. "input": "ftp:example.com/",
  2841. "base": "about:blank",
  2842. "href": "ftp://example.com/",
  2843. "origin": "ftp://example.com",
  2844. "protocol": "ftp:",
  2845. "username": "",
  2846. "password": "",
  2847. "host": "example.com",
  2848. "hostname": "example.com",
  2849. "port": "",
  2850. "pathname": "/",
  2851. "search": "",
  2852. "hash": ""
  2853. },
  2854. {
  2855. "input": "https:example.com/",
  2856. "base": "about:blank",
  2857. "href": "https://example.com/",
  2858. "origin": "https://example.com",
  2859. "protocol": "https:",
  2860. "username": "",
  2861. "password": "",
  2862. "host": "example.com",
  2863. "hostname": "example.com",
  2864. "port": "",
  2865. "pathname": "/",
  2866. "search": "",
  2867. "hash": ""
  2868. },
  2869. {
  2870. "input": "madeupscheme:example.com/",
  2871. "base": "about:blank",
  2872. "href": "madeupscheme:example.com/",
  2873. "origin": "null",
  2874. "protocol": "madeupscheme:",
  2875. "username": "",
  2876. "password": "",
  2877. "host": "",
  2878. "hostname": "",
  2879. "port": "",
  2880. "pathname": "example.com/",
  2881. "search": "",
  2882. "hash": ""
  2883. },
  2884. {
  2885. "input": "ftps:example.com/",
  2886. "base": "about:blank",
  2887. "href": "ftps:example.com/",
  2888. "origin": "null",
  2889. "protocol": "ftps:",
  2890. "username": "",
  2891. "password": "",
  2892. "host": "",
  2893. "hostname": "",
  2894. "port": "",
  2895. "pathname": "example.com/",
  2896. "search": "",
  2897. "hash": ""
  2898. },
  2899. {
  2900. "input": "gopher:example.com/",
  2901. "base": "about:blank",
  2902. "href": "gopher://example.com/",
  2903. "origin": "gopher://example.com",
  2904. "protocol": "gopher:",
  2905. "username": "",
  2906. "password": "",
  2907. "host": "example.com",
  2908. "hostname": "example.com",
  2909. "port": "",
  2910. "pathname": "/",
  2911. "search": "",
  2912. "hash": ""
  2913. },
  2914. {
  2915. "input": "ws:example.com/",
  2916. "base": "about:blank",
  2917. "href": "ws://example.com/",
  2918. "origin": "ws://example.com",
  2919. "protocol": "ws:",
  2920. "username": "",
  2921. "password": "",
  2922. "host": "example.com",
  2923. "hostname": "example.com",
  2924. "port": "",
  2925. "pathname": "/",
  2926. "search": "",
  2927. "hash": ""
  2928. },
  2929. {
  2930. "input": "wss:example.com/",
  2931. "base": "about:blank",
  2932. "href": "wss://example.com/",
  2933. "origin": "wss://example.com",
  2934. "protocol": "wss:",
  2935. "username": "",
  2936. "password": "",
  2937. "host": "example.com",
  2938. "hostname": "example.com",
  2939. "port": "",
  2940. "pathname": "/",
  2941. "search": "",
  2942. "hash": ""
  2943. },
  2944. {
  2945. "input": "data:example.com/",
  2946. "base": "about:blank",
  2947. "href": "data:example.com/",
  2948. "origin": "null",
  2949. "protocol": "data:",
  2950. "username": "",
  2951. "password": "",
  2952. "host": "",
  2953. "hostname": "",
  2954. "port": "",
  2955. "pathname": "example.com/",
  2956. "search": "",
  2957. "hash": ""
  2958. },
  2959. {
  2960. "input": "javascript:example.com/",
  2961. "base": "about:blank",
  2962. "href": "javascript:example.com/",
  2963. "origin": "null",
  2964. "protocol": "javascript:",
  2965. "username": "",
  2966. "password": "",
  2967. "host": "",
  2968. "hostname": "",
  2969. "port": "",
  2970. "pathname": "example.com/",
  2971. "search": "",
  2972. "hash": ""
  2973. },
  2974. {
  2975. "input": "mailto:example.com/",
  2976. "base": "about:blank",
  2977. "href": "mailto:example.com/",
  2978. "origin": "null",
  2979. "protocol": "mailto:",
  2980. "username": "",
  2981. "password": "",
  2982. "host": "",
  2983. "hostname": "",
  2984. "port": "",
  2985. "pathname": "example.com/",
  2986. "search": "",
  2987. "hash": ""
  2988. },
  2989. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html",
  2990. {
  2991. "input": "http:@www.example.com",
  2992. "base": "about:blank",
  2993. "href": "http://www.example.com/",
  2994. "origin": "http://www.example.com",
  2995. "protocol": "http:",
  2996. "username": "",
  2997. "password": "",
  2998. "host": "www.example.com",
  2999. "hostname": "www.example.com",
  3000. "port": "",
  3001. "pathname": "/",
  3002. "search": "",
  3003. "hash": ""
  3004. },
  3005. {
  3006. "input": "http:/@www.example.com",
  3007. "base": "about:blank",
  3008. "href": "http://www.example.com/",
  3009. "origin": "http://www.example.com",
  3010. "protocol": "http:",
  3011. "username": "",
  3012. "password": "",
  3013. "host": "www.example.com",
  3014. "hostname": "www.example.com",
  3015. "port": "",
  3016. "pathname": "/",
  3017. "search": "",
  3018. "hash": ""
  3019. },
  3020. {
  3021. "input": "http://@www.example.com",
  3022. "base": "about:blank",
  3023. "href": "http://www.example.com/",
  3024. "origin": "http://www.example.com",
  3025. "protocol": "http:",
  3026. "username": "",
  3027. "password": "",
  3028. "host": "www.example.com",
  3029. "hostname": "www.example.com",
  3030. "port": "",
  3031. "pathname": "/",
  3032. "search": "",
  3033. "hash": ""
  3034. },
  3035. {
  3036. "input": "http:a:b@www.example.com",
  3037. "base": "about:blank",
  3038. "href": "http://a:b@www.example.com/",
  3039. "origin": "http://www.example.com",
  3040. "protocol": "http:",
  3041. "username": "a",
  3042. "password": "b",
  3043. "host": "www.example.com",
  3044. "hostname": "www.example.com",
  3045. "port": "",
  3046. "pathname": "/",
  3047. "search": "",
  3048. "hash": ""
  3049. },
  3050. {
  3051. "input": "http:/a:b@www.example.com",
  3052. "base": "about:blank",
  3053. "href": "http://a:b@www.example.com/",
  3054. "origin": "http://www.example.com",
  3055. "protocol": "http:",
  3056. "username": "a",
  3057. "password": "b",
  3058. "host": "www.example.com",
  3059. "hostname": "www.example.com",
  3060. "port": "",
  3061. "pathname": "/",
  3062. "search": "",
  3063. "hash": ""
  3064. },
  3065. {
  3066. "input": "http://a:b@www.example.com",
  3067. "base": "about:blank",
  3068. "href": "http://a:b@www.example.com/",
  3069. "origin": "http://www.example.com",
  3070. "protocol": "http:",
  3071. "username": "a",
  3072. "password": "b",
  3073. "host": "www.example.com",
  3074. "hostname": "www.example.com",
  3075. "port": "",
  3076. "pathname": "/",
  3077. "search": "",
  3078. "hash": ""
  3079. },
  3080. {
  3081. "input": "http://@pple.com",
  3082. "base": "about:blank",
  3083. "href": "http://pple.com/",
  3084. "origin": "http://pple.com",
  3085. "protocol": "http:",
  3086. "username": "",
  3087. "password": "",
  3088. "host": "pple.com",
  3089. "hostname": "pple.com",
  3090. "port": "",
  3091. "pathname": "/",
  3092. "search": "",
  3093. "hash": ""
  3094. },
  3095. {
  3096. "input": "http::b@www.example.com",
  3097. "base": "about:blank",
  3098. "href": "http://:b@www.example.com/",
  3099. "origin": "http://www.example.com",
  3100. "protocol": "http:",
  3101. "username": "",
  3102. "password": "b",
  3103. "host": "www.example.com",
  3104. "hostname": "www.example.com",
  3105. "port": "",
  3106. "pathname": "/",
  3107. "search": "",
  3108. "hash": ""
  3109. },
  3110. {
  3111. "input": "http:/:b@www.example.com",
  3112. "base": "about:blank",
  3113. "href": "http://:b@www.example.com/",
  3114. "origin": "http://www.example.com",
  3115. "protocol": "http:",
  3116. "username": "",
  3117. "password": "b",
  3118. "host": "www.example.com",
  3119. "hostname": "www.example.com",
  3120. "port": "",
  3121. "pathname": "/",
  3122. "search": "",
  3123. "hash": ""
  3124. },
  3125. {
  3126. "input": "http://:b@www.example.com",
  3127. "base": "about:blank",
  3128. "href": "http://:b@www.example.com/",
  3129. "origin": "http://www.example.com",
  3130. "protocol": "http:",
  3131. "username": "",
  3132. "password": "b",
  3133. "host": "www.example.com",
  3134. "hostname": "www.example.com",
  3135. "port": "",
  3136. "pathname": "/",
  3137. "search": "",
  3138. "hash": ""
  3139. },
  3140. {
  3141. "input": "http:/:@/www.example.com",
  3142. "base": "about:blank",
  3143. "failure": true
  3144. },
  3145. {
  3146. "input": "http://user@/www.example.com",
  3147. "base": "about:blank",
  3148. "failure": true
  3149. },
  3150. {
  3151. "input": "http:@/www.example.com",
  3152. "base": "about:blank",
  3153. "failure": true
  3154. },
  3155. {
  3156. "input": "http:/@/www.example.com",
  3157. "base": "about:blank",
  3158. "failure": true
  3159. },
  3160. {
  3161. "input": "http://@/www.example.com",
  3162. "base": "about:blank",
  3163. "failure": true
  3164. },
  3165. {
  3166. "input": "https:@/www.example.com",
  3167. "base": "about:blank",
  3168. "failure": true
  3169. },
  3170. {
  3171. "input": "http:a:b@/www.example.com",
  3172. "base": "about:blank",
  3173. "failure": true
  3174. },
  3175. {
  3176. "input": "http:/a:b@/www.example.com",
  3177. "base": "about:blank",
  3178. "failure": true
  3179. },
  3180. {
  3181. "input": "http://a:b@/www.example.com",
  3182. "base": "about:blank",
  3183. "failure": true
  3184. },
  3185. {
  3186. "input": "http::@/www.example.com",
  3187. "base": "about:blank",
  3188. "failure": true
  3189. },
  3190. {
  3191. "input": "http:a:@www.example.com",
  3192. "base": "about:blank",
  3193. "href": "http://a@www.example.com/",
  3194. "origin": "http://www.example.com",
  3195. "protocol": "http:",
  3196. "username": "a",
  3197. "password": "",
  3198. "host": "www.example.com",
  3199. "hostname": "www.example.com",
  3200. "port": "",
  3201. "pathname": "/",
  3202. "search": "",
  3203. "hash": ""
  3204. },
  3205. {
  3206. "input": "http:/a:@www.example.com",
  3207. "base": "about:blank",
  3208. "href": "http://a@www.example.com/",
  3209. "origin": "http://www.example.com",
  3210. "protocol": "http:",
  3211. "username": "a",
  3212. "password": "",
  3213. "host": "www.example.com",
  3214. "hostname": "www.example.com",
  3215. "port": "",
  3216. "pathname": "/",
  3217. "search": "",
  3218. "hash": ""
  3219. },
  3220. {
  3221. "input": "http://a:@www.example.com",
  3222. "base": "about:blank",
  3223. "href": "http://a@www.example.com/",
  3224. "origin": "http://www.example.com",
  3225. "protocol": "http:",
  3226. "username": "a",
  3227. "password": "",
  3228. "host": "www.example.com",
  3229. "hostname": "www.example.com",
  3230. "port": "",
  3231. "pathname": "/",
  3232. "search": "",
  3233. "hash": ""
  3234. },
  3235. {
  3236. "input": "http://www.@pple.com",
  3237. "base": "about:blank",
  3238. "href": "http://www.@pple.com/",
  3239. "origin": "http://pple.com",
  3240. "protocol": "http:",
  3241. "username": "www.",
  3242. "password": "",
  3243. "host": "pple.com",
  3244. "hostname": "pple.com",
  3245. "port": "",
  3246. "pathname": "/",
  3247. "search": "",
  3248. "hash": ""
  3249. },
  3250. {
  3251. "input": "http:@:www.example.com",
  3252. "base": "about:blank",
  3253. "failure": true
  3254. },
  3255. {
  3256. "input": "http:/@:www.example.com",
  3257. "base": "about:blank",
  3258. "failure": true
  3259. },
  3260. {
  3261. "input": "http://@:www.example.com",
  3262. "base": "about:blank",
  3263. "failure": true
  3264. },
  3265. {
  3266. "input": "http://:@www.example.com",
  3267. "base": "about:blank",
  3268. "href": "http://www.example.com/",
  3269. "origin": "http://www.example.com",
  3270. "protocol": "http:",
  3271. "username": "",
  3272. "password": "",
  3273. "host": "www.example.com",
  3274. "hostname": "www.example.com",
  3275. "port": "",
  3276. "pathname": "/",
  3277. "search": "",
  3278. "hash": ""
  3279. },
  3280. "# Others",
  3281. {
  3282. "input": "/",
  3283. "base": "http://www.example.com/test",
  3284. "href": "http://www.example.com/",
  3285. "origin": "http://www.example.com",
  3286. "protocol": "http:",
  3287. "username": "",
  3288. "password": "",
  3289. "host": "www.example.com",
  3290. "hostname": "www.example.com",
  3291. "port": "",
  3292. "pathname": "/",
  3293. "search": "",
  3294. "hash": ""
  3295. },
  3296. {
  3297. "input": "/test.txt",
  3298. "base": "http://www.example.com/test",
  3299. "href": "http://www.example.com/test.txt",
  3300. "origin": "http://www.example.com",
  3301. "protocol": "http:",
  3302. "username": "",
  3303. "password": "",
  3304. "host": "www.example.com",
  3305. "hostname": "www.example.com",
  3306. "port": "",
  3307. "pathname": "/test.txt",
  3308. "search": "",
  3309. "hash": ""
  3310. },
  3311. {
  3312. "input": ".",
  3313. "base": "http://www.example.com/test",
  3314. "href": "http://www.example.com/",
  3315. "origin": "http://www.example.com",
  3316. "protocol": "http:",
  3317. "username": "",
  3318. "password": "",
  3319. "host": "www.example.com",
  3320. "hostname": "www.example.com",
  3321. "port": "",
  3322. "pathname": "/",
  3323. "search": "",
  3324. "hash": ""
  3325. },
  3326. {
  3327. "input": "..",
  3328. "base": "http://www.example.com/test",
  3329. "href": "http://www.example.com/",
  3330. "origin": "http://www.example.com",
  3331. "protocol": "http:",
  3332. "username": "",
  3333. "password": "",
  3334. "host": "www.example.com",
  3335. "hostname": "www.example.com",
  3336. "port": "",
  3337. "pathname": "/",
  3338. "search": "",
  3339. "hash": ""
  3340. },
  3341. {
  3342. "input": "test.txt",
  3343. "base": "http://www.example.com/test",
  3344. "href": "http://www.example.com/test.txt",
  3345. "origin": "http://www.example.com",
  3346. "protocol": "http:",
  3347. "username": "",
  3348. "password": "",
  3349. "host": "www.example.com",
  3350. "hostname": "www.example.com",
  3351. "port": "",
  3352. "pathname": "/test.txt",
  3353. "search": "",
  3354. "hash": ""
  3355. },
  3356. {
  3357. "input": "./test.txt",
  3358. "base": "http://www.example.com/test",
  3359. "href": "http://www.example.com/test.txt",
  3360. "origin": "http://www.example.com",
  3361. "protocol": "http:",
  3362. "username": "",
  3363. "password": "",
  3364. "host": "www.example.com",
  3365. "hostname": "www.example.com",
  3366. "port": "",
  3367. "pathname": "/test.txt",
  3368. "search": "",
  3369. "hash": ""
  3370. },
  3371. {
  3372. "input": "../test.txt",
  3373. "base": "http://www.example.com/test",
  3374. "href": "http://www.example.com/test.txt",
  3375. "origin": "http://www.example.com",
  3376. "protocol": "http:",
  3377. "username": "",
  3378. "password": "",
  3379. "host": "www.example.com",
  3380. "hostname": "www.example.com",
  3381. "port": "",
  3382. "pathname": "/test.txt",
  3383. "search": "",
  3384. "hash": ""
  3385. },
  3386. {
  3387. "input": "../aaa/test.txt",
  3388. "base": "http://www.example.com/test",
  3389. "href": "http://www.example.com/aaa/test.txt",
  3390. "origin": "http://www.example.com",
  3391. "protocol": "http:",
  3392. "username": "",
  3393. "password": "",
  3394. "host": "www.example.com",
  3395. "hostname": "www.example.com",
  3396. "port": "",
  3397. "pathname": "/aaa/test.txt",
  3398. "search": "",
  3399. "hash": ""
  3400. },
  3401. {
  3402. "input": "../../test.txt",
  3403. "base": "http://www.example.com/test",
  3404. "href": "http://www.example.com/test.txt",
  3405. "origin": "http://www.example.com",
  3406. "protocol": "http:",
  3407. "username": "",
  3408. "password": "",
  3409. "host": "www.example.com",
  3410. "hostname": "www.example.com",
  3411. "port": "",
  3412. "pathname": "/test.txt",
  3413. "search": "",
  3414. "hash": ""
  3415. },
  3416. {
  3417. "input": "中/test.txt",
  3418. "base": "http://www.example.com/test",
  3419. "href": "http://www.example.com/%E4%B8%AD/test.txt",
  3420. "origin": "http://www.example.com",
  3421. "protocol": "http:",
  3422. "username": "",
  3423. "password": "",
  3424. "host": "www.example.com",
  3425. "hostname": "www.example.com",
  3426. "port": "",
  3427. "pathname": "/%E4%B8%AD/test.txt",
  3428. "search": "",
  3429. "hash": ""
  3430. },
  3431. {
  3432. "input": "http://www.example2.com",
  3433. "base": "http://www.example.com/test",
  3434. "href": "http://www.example2.com/",
  3435. "origin": "http://www.example2.com",
  3436. "protocol": "http:",
  3437. "username": "",
  3438. "password": "",
  3439. "host": "www.example2.com",
  3440. "hostname": "www.example2.com",
  3441. "port": "",
  3442. "pathname": "/",
  3443. "search": "",
  3444. "hash": ""
  3445. },
  3446. {
  3447. "input": "//www.example2.com",
  3448. "base": "http://www.example.com/test",
  3449. "href": "http://www.example2.com/",
  3450. "origin": "http://www.example2.com",
  3451. "protocol": "http:",
  3452. "username": "",
  3453. "password": "",
  3454. "host": "www.example2.com",
  3455. "hostname": "www.example2.com",
  3456. "port": "",
  3457. "pathname": "/",
  3458. "search": "",
  3459. "hash": ""
  3460. },
  3461. {
  3462. "input": "file:...",
  3463. "base": "http://www.example.com/test",
  3464. "href": "file:///...",
  3465. "protocol": "file:",
  3466. "username": "",
  3467. "password": "",
  3468. "host": "",
  3469. "hostname": "",
  3470. "port": "",
  3471. "pathname": "/...",
  3472. "search": "",
  3473. "hash": ""
  3474. },
  3475. {
  3476. "input": "file:..",
  3477. "base": "http://www.example.com/test",
  3478. "href": "file:///",
  3479. "protocol": "file:",
  3480. "username": "",
  3481. "password": "",
  3482. "host": "",
  3483. "hostname": "",
  3484. "port": "",
  3485. "pathname": "/",
  3486. "search": "",
  3487. "hash": ""
  3488. },
  3489. {
  3490. "input": "file:a",
  3491. "base": "http://www.example.com/test",
  3492. "href": "file:///a",
  3493. "protocol": "file:",
  3494. "username": "",
  3495. "password": "",
  3496. "host": "",
  3497. "hostname": "",
  3498. "port": "",
  3499. "pathname": "/a",
  3500. "search": "",
  3501. "hash": ""
  3502. },
  3503. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
  3504. "Basic canonicalization, uppercase should be converted to lowercase",
  3505. {
  3506. "input": "http://ExAmPlE.CoM",
  3507. "base": "http://other.com/",
  3508. "href": "http://example.com/",
  3509. "origin": "http://example.com",
  3510. "protocol": "http:",
  3511. "username": "",
  3512. "password": "",
  3513. "host": "example.com",
  3514. "hostname": "example.com",
  3515. "port": "",
  3516. "pathname": "/",
  3517. "search": "",
  3518. "hash": ""
  3519. },
  3520. {
  3521. "input": "http://example example.com",
  3522. "base": "http://other.com/",
  3523. "failure": true
  3524. },
  3525. {
  3526. "input": "http://Goo%20 goo%7C|.com",
  3527. "base": "http://other.com/",
  3528. "failure": true
  3529. },
  3530. {
  3531. "input": "http://[]",
  3532. "base": "http://other.com/",
  3533. "failure": true
  3534. },
  3535. {
  3536. "input": "http://[:]",
  3537. "base": "http://other.com/",
  3538. "failure": true
  3539. },
  3540. "U+3000 is mapped to U+0020 (space) which is disallowed",
  3541. {
  3542. "input": "http://GOO\u00a0\u3000goo.com",
  3543. "base": "http://other.com/",
  3544. "failure": true
  3545. },
  3546. "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",
  3547. {
  3548. "input": "http://GOO\u200b\u2060\ufeffgoo.com",
  3549. "base": "http://other.com/",
  3550. "href": "http://googoo.com/",
  3551. "origin": "http://googoo.com",
  3552. "protocol": "http:",
  3553. "username": "",
  3554. "password": "",
  3555. "host": "googoo.com",
  3556. "hostname": "googoo.com",
  3557. "port": "",
  3558. "pathname": "/",
  3559. "search": "",
  3560. "hash": ""
  3561. },
  3562. "Leading and trailing C0 control or space",
  3563. {
  3564. "input": "\u0000\u001b\u0004\u0012 http://example.com/\u001f \u000d ",
  3565. "base": "about:blank",
  3566. "href": "http://example.com/",
  3567. "origin": "http://example.com",
  3568. "protocol": "http:",
  3569. "username": "",
  3570. "password": "",
  3571. "host": "example.com",
  3572. "hostname": "example.com",
  3573. "port": "",
  3574. "pathname": "/",
  3575. "search": "",
  3576. "hash": ""
  3577. },
  3578. "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
  3579. {
  3580. "input": "http://www.foo。bar.com",
  3581. "base": "http://other.com/",
  3582. "href": "http://www.foo.bar.com/",
  3583. "origin": "http://www.foo.bar.com",
  3584. "protocol": "http:",
  3585. "username": "",
  3586. "password": "",
  3587. "host": "www.foo.bar.com",
  3588. "hostname": "www.foo.bar.com",
  3589. "port": "",
  3590. "pathname": "/",
  3591. "search": "",
  3592. "hash": ""
  3593. },
  3594. "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0",
  3595. {
  3596. "input": "http://\ufdd0zyx.com",
  3597. "base": "http://other.com/",
  3598. "failure": true
  3599. },
  3600. "This is the same as previous but escaped",
  3601. {
  3602. "input": "http://%ef%b7%90zyx.com",
  3603. "base": "http://other.com/",
  3604. "failure": true
  3605. },
  3606. "U+FFFD",
  3607. {
  3608. "input": "https://\ufffd",
  3609. "base": "about:blank",
  3610. "failure": true
  3611. },
  3612. {
  3613. "input": "https://%EF%BF%BD",
  3614. "base": "about:blank",
  3615. "failure": true
  3616. },
  3617. {
  3618. "input": "https://x/\ufffd?\ufffd#\ufffd",
  3619. "base": "about:blank",
  3620. "href": "https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD",
  3621. "origin": "https://x",
  3622. "protocol": "https:",
  3623. "username": "",
  3624. "password": "",
  3625. "host": "x",
  3626. "hostname": "x",
  3627. "port": "",
  3628. "pathname": "/%EF%BF%BD",
  3629. "search": "?%EF%BF%BD",
  3630. "hash": "#%EF%BF%BD"
  3631. },
  3632. "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.",
  3633. {
  3634. "input": "http://Go.com",
  3635. "base": "http://other.com/",
  3636. "href": "http://go.com/",
  3637. "origin": "http://go.com",
  3638. "protocol": "http:",
  3639. "username": "",
  3640. "password": "",
  3641. "host": "go.com",
  3642. "hostname": "go.com",
  3643. "port": "",
  3644. "pathname": "/",
  3645. "search": "",
  3646. "hash": ""
  3647. },
  3648. "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257",
  3649. {
  3650. "input": "http://%41.com",
  3651. "base": "http://other.com/",
  3652. "failure": true
  3653. },
  3654. {
  3655. "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com",
  3656. "base": "http://other.com/",
  3657. "failure": true
  3658. },
  3659. "...%00 in fullwidth should fail (also as escaped UTF-8 input)",
  3660. {
  3661. "input": "http://%00.com",
  3662. "base": "http://other.com/",
  3663. "failure": true
  3664. },
  3665. {
  3666. "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com",
  3667. "base": "http://other.com/",
  3668. "failure": true
  3669. },
  3670. "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
  3671. {
  3672. "input": "http://你好你好",
  3673. "base": "http://other.com/",
  3674. "href": "http://xn--6qqa088eba/",
  3675. "origin": "http://xn--6qqa088eba",
  3676. "protocol": "http:",
  3677. "username": "",
  3678. "password": "",
  3679. "host": "xn--6qqa088eba",
  3680. "hostname": "xn--6qqa088eba",
  3681. "port": "",
  3682. "pathname": "/",
  3683. "search": "",
  3684. "hash": ""
  3685. },
  3686. {
  3687. "input": "sc://faß.ExAmPlE/",
  3688. "base": "about:blank",
  3689. "href": "sc://fa%C3%9F.ExAmPlE/",
  3690. "origin": "null",
  3691. "protocol": "sc:",
  3692. "username": "",
  3693. "password": "",
  3694. "host": "fa%C3%9F.ExAmPlE",
  3695. "hostname": "fa%C3%9F.ExAmPlE",
  3696. "port": "",
  3697. "pathname": "/",
  3698. "search": "",
  3699. "hash": ""
  3700. },
  3701. "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191",
  3702. {
  3703. "input": "http://%zz%66%a.com",
  3704. "base": "http://other.com/",
  3705. "failure": true
  3706. },
  3707. "If we get an invalid character that has been escaped.",
  3708. {
  3709. "input": "http://%25",
  3710. "base": "http://other.com/",
  3711. "failure": true
  3712. },
  3713. {
  3714. "input": "http://hello%00",
  3715. "base": "http://other.com/",
  3716. "failure": true
  3717. },
  3718. "Escaped numbers should be treated like IP addresses if they are.",
  3719. {
  3720. "input": "http://%30%78%63%30%2e%30%32%35%30.01",
  3721. "base": "http://other.com/",
  3722. "href": "http://192.168.0.1/",
  3723. "origin": "http://192.168.0.1",
  3724. "protocol": "http:",
  3725. "username": "",
  3726. "password": "",
  3727. "host": "192.168.0.1",
  3728. "hostname": "192.168.0.1",
  3729. "port": "",
  3730. "pathname": "/",
  3731. "search": "",
  3732. "hash": ""
  3733. },
  3734. {
  3735. "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e",
  3736. "base": "http://other.com/",
  3737. "href": "http://192.168.0.1/",
  3738. "origin": "http://192.168.0.1",
  3739. "protocol": "http:",
  3740. "username": "",
  3741. "password": "",
  3742. "host": "192.168.0.1",
  3743. "hostname": "192.168.0.1",
  3744. "port": "",
  3745. "pathname": "/",
  3746. "search": "",
  3747. "hash": ""
  3748. },
  3749. {
  3750. "input": "http://192.168.0.257",
  3751. "base": "http://other.com/",
  3752. "failure": true
  3753. },
  3754. "Invalid escaping in hosts causes failure",
  3755. {
  3756. "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01",
  3757. "base": "http://other.com/",
  3758. "failure": true
  3759. },
  3760. "A space in a host causes failure",
  3761. {
  3762. "input": "http://192.168.0.1 hello",
  3763. "base": "http://other.com/",
  3764. "failure": true
  3765. },
  3766. {
  3767. "input": "https://x x:12",
  3768. "base": "about:blank",
  3769. "failure": true
  3770. },
  3771. "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
  3772. {
  3773. "input": "http://0Xc0.0250.01",
  3774. "base": "http://other.com/",
  3775. "href": "http://192.168.0.1/",
  3776. "origin": "http://192.168.0.1",
  3777. "protocol": "http:",
  3778. "username": "",
  3779. "password": "",
  3780. "host": "192.168.0.1",
  3781. "hostname": "192.168.0.1",
  3782. "port": "",
  3783. "pathname": "/",
  3784. "search": "",
  3785. "hash": ""
  3786. },
  3787. "Domains with empty labels",
  3788. {
  3789. "input": "http://./",
  3790. "base": "about:blank",
  3791. "href": "http://./",
  3792. "origin": "http://.",
  3793. "protocol": "http:",
  3794. "username": "",
  3795. "password": "",
  3796. "host": ".",
  3797. "hostname": ".",
  3798. "port": "",
  3799. "pathname": "/",
  3800. "search": "",
  3801. "hash": ""
  3802. },
  3803. {
  3804. "input": "http://../",
  3805. "base": "about:blank",
  3806. "href": "http://../",
  3807. "origin": "http://..",
  3808. "protocol": "http:",
  3809. "username": "",
  3810. "password": "",
  3811. "host": "..",
  3812. "hostname": "..",
  3813. "port": "",
  3814. "pathname": "/",
  3815. "search": "",
  3816. "hash": ""
  3817. },
  3818. {
  3819. "input": "http://0..0x300/",
  3820. "base": "about:blank",
  3821. "href": "http://0..0x300/",
  3822. "origin": "http://0..0x300",
  3823. "protocol": "http:",
  3824. "username": "",
  3825. "password": "",
  3826. "host": "0..0x300",
  3827. "hostname": "0..0x300",
  3828. "port": "",
  3829. "pathname": "/",
  3830. "search": "",
  3831. "hash": ""
  3832. },
  3833. "Broken IPv6",
  3834. {
  3835. "input": "http://[www.google.com]/",
  3836. "base": "about:blank",
  3837. "failure": true
  3838. },
  3839. {
  3840. "input": "http://[google.com]",
  3841. "base": "http://other.com/",
  3842. "failure": true
  3843. },
  3844. {
  3845. "input": "http://[::1.2.3.4x]",
  3846. "base": "http://other.com/",
  3847. "failure": true
  3848. },
  3849. {
  3850. "input": "http://[::1.2.3.]",
  3851. "base": "http://other.com/",
  3852. "failure": true
  3853. },
  3854. {
  3855. "input": "http://[::1.2.]",
  3856. "base": "http://other.com/",
  3857. "failure": true
  3858. },
  3859. {
  3860. "input": "http://[::1.]",
  3861. "base": "http://other.com/",
  3862. "failure": true
  3863. },
  3864. "Misc Unicode",
  3865. {
  3866. "input": "http://foo:💩@example.com/bar",
  3867. "base": "http://other.com/",
  3868. "href": "http://foo:%F0%9F%92%A9@example.com/bar",
  3869. "origin": "http://example.com",
  3870. "protocol": "http:",
  3871. "username": "foo",
  3872. "password": "%F0%9F%92%A9",
  3873. "host": "example.com",
  3874. "hostname": "example.com",
  3875. "port": "",
  3876. "pathname": "/bar",
  3877. "search": "",
  3878. "hash": ""
  3879. },
  3880. "# resolving a fragment against any scheme succeeds",
  3881. {
  3882. "input": "#",
  3883. "base": "test:test",
  3884. "href": "test:test#",
  3885. "origin": "null",
  3886. "protocol": "test:",
  3887. "username": "",
  3888. "password": "",
  3889. "host": "",
  3890. "hostname": "",
  3891. "port": "",
  3892. "pathname": "test",
  3893. "search": "",
  3894. "hash": ""
  3895. },
  3896. {
  3897. "input": "#x",
  3898. "base": "mailto:x@x.com",
  3899. "href": "mailto:x@x.com#x",
  3900. "origin": "null",
  3901. "protocol": "mailto:",
  3902. "username": "",
  3903. "password": "",
  3904. "host": "",
  3905. "hostname": "",
  3906. "port": "",
  3907. "pathname": "x@x.com",
  3908. "search": "",
  3909. "hash": "#x"
  3910. },
  3911. {
  3912. "input": "#x",
  3913. "base": "data:,",
  3914. "href": "data:,#x",
  3915. "origin": "null",
  3916. "protocol": "data:",
  3917. "username": "",
  3918. "password": "",
  3919. "host": "",
  3920. "hostname": "",
  3921. "port": "",
  3922. "pathname": ",",
  3923. "search": "",
  3924. "hash": "#x"
  3925. },
  3926. {
  3927. "input": "#x",
  3928. "base": "about:blank",
  3929. "href": "about:blank#x",
  3930. "origin": "null",
  3931. "protocol": "about:",
  3932. "username": "",
  3933. "password": "",
  3934. "host": "",
  3935. "hostname": "",
  3936. "port": "",
  3937. "pathname": "blank",
  3938. "search": "",
  3939. "hash": "#x"
  3940. },
  3941. {
  3942. "input": "#",
  3943. "base": "test:test?test",
  3944. "href": "test:test?test#",
  3945. "origin": "null",
  3946. "protocol": "test:",
  3947. "username": "",
  3948. "password": "",
  3949. "host": "",
  3950. "hostname": "",
  3951. "port": "",
  3952. "pathname": "test",
  3953. "search": "?test",
  3954. "hash": ""
  3955. },
  3956. "# multiple @ in authority state",
  3957. {
  3958. "input": "https://@test@test@example:800/",
  3959. "base": "http://doesnotmatter/",
  3960. "href": "https://%40test%40test@example:800/",
  3961. "origin": "https://example:800",
  3962. "protocol": "https:",
  3963. "username": "%40test%40test",
  3964. "password": "",
  3965. "host": "example:800",
  3966. "hostname": "example",
  3967. "port": "800",
  3968. "pathname": "/",
  3969. "search": "",
  3970. "hash": ""
  3971. },
  3972. {
  3973. "input": "https://@@@example",
  3974. "base": "http://doesnotmatter/",
  3975. "href": "https://%40%40@example/",
  3976. "origin": "https://example",
  3977. "protocol": "https:",
  3978. "username": "%40%40",
  3979. "password": "",
  3980. "host": "example",
  3981. "hostname": "example",
  3982. "port": "",
  3983. "pathname": "/",
  3984. "search": "",
  3985. "hash": ""
  3986. },
  3987. "non-az-09 characters",
  3988. {
  3989. "input": "http://`{}:`{}@h/`{}?`{}",
  3990. "base": "http://doesnotmatter/",
  3991. "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}",
  3992. "origin": "http://h",
  3993. "protocol": "http:",
  3994. "username": "%60%7B%7D",
  3995. "password": "%60%7B%7D",
  3996. "host": "h",
  3997. "hostname": "h",
  3998. "port": "",
  3999. "pathname": "/%60%7B%7D",
  4000. "search": "?`{}",
  4001. "hash": ""
  4002. },
  4003. "# Credentials in base",
  4004. {
  4005. "input": "/some/path",
  4006. "base": "http://user@example.org/smth",
  4007. "href": "http://user@example.org/some/path",
  4008. "origin": "http://example.org",
  4009. "protocol": "http:",
  4010. "username": "user",
  4011. "password": "",
  4012. "host": "example.org",
  4013. "hostname": "example.org",
  4014. "port": "",
  4015. "pathname": "/some/path",
  4016. "search": "",
  4017. "hash": ""
  4018. },
  4019. {
  4020. "input": "",
  4021. "base": "http://user:pass@example.org:21/smth",
  4022. "href": "http://user:pass@example.org:21/smth",
  4023. "origin": "http://example.org:21",
  4024. "protocol": "http:",
  4025. "username": "user",
  4026. "password": "pass",
  4027. "host": "example.org:21",
  4028. "hostname": "example.org",
  4029. "port": "21",
  4030. "pathname": "/smth",
  4031. "search": "",
  4032. "hash": ""
  4033. },
  4034. {
  4035. "input": "/some/path",
  4036. "base": "http://user:pass@example.org:21/smth",
  4037. "href": "http://user:pass@example.org:21/some/path",
  4038. "origin": "http://example.org:21",
  4039. "protocol": "http:",
  4040. "username": "user",
  4041. "password": "pass",
  4042. "host": "example.org:21",
  4043. "hostname": "example.org",
  4044. "port": "21",
  4045. "pathname": "/some/path",
  4046. "search": "",
  4047. "hash": ""
  4048. },
  4049. "# a set of tests designed by zcorpan for relative URLs with unknown schemes",
  4050. {
  4051. "input": "i",
  4052. "base": "sc:sd",
  4053. "failure": true
  4054. },
  4055. {
  4056. "input": "i",
  4057. "base": "sc:sd/sd",
  4058. "failure": true
  4059. },
  4060. {
  4061. "input": "i",
  4062. "base": "sc:/pa/pa",
  4063. "href": "sc:/pa/i",
  4064. "origin": "null",
  4065. "protocol": "sc:",
  4066. "username": "",
  4067. "password": "",
  4068. "host": "",
  4069. "hostname": "",
  4070. "port": "",
  4071. "pathname": "/pa/i",
  4072. "search": "",
  4073. "hash": ""
  4074. },
  4075. {
  4076. "input": "i",
  4077. "base": "sc://ho/pa",
  4078. "href": "sc://ho/i",
  4079. "origin": "null",
  4080. "protocol": "sc:",
  4081. "username": "",
  4082. "password": "",
  4083. "host": "ho",
  4084. "hostname": "ho",
  4085. "port": "",
  4086. "pathname": "/i",
  4087. "search": "",
  4088. "hash": ""
  4089. },
  4090. {
  4091. "input": "i",
  4092. "base": "sc:///pa/pa",
  4093. "href": "sc:///pa/i",
  4094. "origin": "null",
  4095. "protocol": "sc:",
  4096. "username": "",
  4097. "password": "",
  4098. "host": "",
  4099. "hostname": "",
  4100. "port": "",
  4101. "pathname": "/pa/i",
  4102. "search": "",
  4103. "hash": ""
  4104. },
  4105. {
  4106. "input": "../i",
  4107. "base": "sc:sd",
  4108. "failure": true
  4109. },
  4110. {
  4111. "input": "../i",
  4112. "base": "sc:sd/sd",
  4113. "failure": true
  4114. },
  4115. {
  4116. "input": "../i",
  4117. "base": "sc:/pa/pa",
  4118. "href": "sc:/i",
  4119. "origin": "null",
  4120. "protocol": "sc:",
  4121. "username": "",
  4122. "password": "",
  4123. "host": "",
  4124. "hostname": "",
  4125. "port": "",
  4126. "pathname": "/i",
  4127. "search": "",
  4128. "hash": ""
  4129. },
  4130. {
  4131. "input": "../i",
  4132. "base": "sc://ho/pa",
  4133. "href": "sc://ho/i",
  4134. "origin": "null",
  4135. "protocol": "sc:",
  4136. "username": "",
  4137. "password": "",
  4138. "host": "ho",
  4139. "hostname": "ho",
  4140. "port": "",
  4141. "pathname": "/i",
  4142. "search": "",
  4143. "hash": ""
  4144. },
  4145. {
  4146. "input": "../i",
  4147. "base": "sc:///pa/pa",
  4148. "href": "sc:///i",
  4149. "origin": "null",
  4150. "protocol": "sc:",
  4151. "username": "",
  4152. "password": "",
  4153. "host": "",
  4154. "hostname": "",
  4155. "port": "",
  4156. "pathname": "/i",
  4157. "search": "",
  4158. "hash": ""
  4159. },
  4160. {
  4161. "input": "/i",
  4162. "base": "sc:sd",
  4163. "failure": true
  4164. },
  4165. {
  4166. "input": "/i",
  4167. "base": "sc:sd/sd",
  4168. "failure": true
  4169. },
  4170. {
  4171. "input": "/i",
  4172. "base": "sc:/pa/pa",
  4173. "href": "sc:/i",
  4174. "origin": "null",
  4175. "protocol": "sc:",
  4176. "username": "",
  4177. "password": "",
  4178. "host": "",
  4179. "hostname": "",
  4180. "port": "",
  4181. "pathname": "/i",
  4182. "search": "",
  4183. "hash": ""
  4184. },
  4185. {
  4186. "input": "/i",
  4187. "base": "sc://ho/pa",
  4188. "href": "sc://ho/i",
  4189. "origin": "null",
  4190. "protocol": "sc:",
  4191. "username": "",
  4192. "password": "",
  4193. "host": "ho",
  4194. "hostname": "ho",
  4195. "port": "",
  4196. "pathname": "/i",
  4197. "search": "",
  4198. "hash": ""
  4199. },
  4200. {
  4201. "input": "/i",
  4202. "base": "sc:///pa/pa",
  4203. "href": "sc:///i",
  4204. "origin": "null",
  4205. "protocol": "sc:",
  4206. "username": "",
  4207. "password": "",
  4208. "host": "",
  4209. "hostname": "",
  4210. "port": "",
  4211. "pathname": "/i",
  4212. "search": "",
  4213. "hash": ""
  4214. },
  4215. {
  4216. "input": "?i",
  4217. "base": "sc:sd",
  4218. "failure": true
  4219. },
  4220. {
  4221. "input": "?i",
  4222. "base": "sc:sd/sd",
  4223. "failure": true
  4224. },
  4225. {
  4226. "input": "?i",
  4227. "base": "sc:/pa/pa",
  4228. "href": "sc:/pa/pa?i",
  4229. "origin": "null",
  4230. "protocol": "sc:",
  4231. "username": "",
  4232. "password": "",
  4233. "host": "",
  4234. "hostname": "",
  4235. "port": "",
  4236. "pathname": "/pa/pa",
  4237. "search": "?i",
  4238. "hash": ""
  4239. },
  4240. {
  4241. "input": "?i",
  4242. "base": "sc://ho/pa",
  4243. "href": "sc://ho/pa?i",
  4244. "origin": "null",
  4245. "protocol": "sc:",
  4246. "username": "",
  4247. "password": "",
  4248. "host": "ho",
  4249. "hostname": "ho",
  4250. "port": "",
  4251. "pathname": "/pa",
  4252. "search": "?i",
  4253. "hash": ""
  4254. },
  4255. {
  4256. "input": "?i",
  4257. "base": "sc:///pa/pa",
  4258. "href": "sc:///pa/pa?i",
  4259. "origin": "null",
  4260. "protocol": "sc:",
  4261. "username": "",
  4262. "password": "",
  4263. "host": "",
  4264. "hostname": "",
  4265. "port": "",
  4266. "pathname": "/pa/pa",
  4267. "search": "?i",
  4268. "hash": ""
  4269. },
  4270. {
  4271. "input": "#i",
  4272. "base": "sc:sd",
  4273. "href": "sc:sd#i",
  4274. "origin": "null",
  4275. "protocol": "sc:",
  4276. "username": "",
  4277. "password": "",
  4278. "host": "",
  4279. "hostname": "",
  4280. "port": "",
  4281. "pathname": "sd",
  4282. "search": "",
  4283. "hash": "#i"
  4284. },
  4285. {
  4286. "input": "#i",
  4287. "base": "sc:sd/sd",
  4288. "href": "sc:sd/sd#i",
  4289. "origin": "null",
  4290. "protocol": "sc:",
  4291. "username": "",
  4292. "password": "",
  4293. "host": "",
  4294. "hostname": "",
  4295. "port": "",
  4296. "pathname": "sd/sd",
  4297. "search": "",
  4298. "hash": "#i"
  4299. },
  4300. {
  4301. "input": "#i",
  4302. "base": "sc:/pa/pa",
  4303. "href": "sc:/pa/pa#i",
  4304. "origin": "null",
  4305. "protocol": "sc:",
  4306. "username": "",
  4307. "password": "",
  4308. "host": "",
  4309. "hostname": "",
  4310. "port": "",
  4311. "pathname": "/pa/pa",
  4312. "search": "",
  4313. "hash": "#i"
  4314. },
  4315. {
  4316. "input": "#i",
  4317. "base": "sc://ho/pa",
  4318. "href": "sc://ho/pa#i",
  4319. "origin": "null",
  4320. "protocol": "sc:",
  4321. "username": "",
  4322. "password": "",
  4323. "host": "ho",
  4324. "hostname": "ho",
  4325. "port": "",
  4326. "pathname": "/pa",
  4327. "search": "",
  4328. "hash": "#i"
  4329. },
  4330. {
  4331. "input": "#i",
  4332. "base": "sc:///pa/pa",
  4333. "href": "sc:///pa/pa#i",
  4334. "origin": "null",
  4335. "protocol": "sc:",
  4336. "username": "",
  4337. "password": "",
  4338. "host": "",
  4339. "hostname": "",
  4340. "port": "",
  4341. "pathname": "/pa/pa",
  4342. "search": "",
  4343. "hash": "#i"
  4344. },
  4345. "# make sure that relative URL logic works on known typically non-relative schemes too",
  4346. {
  4347. "input": "about:/../",
  4348. "base": "about:blank",
  4349. "href": "about:/",
  4350. "origin": "null",
  4351. "protocol": "about:",
  4352. "username": "",
  4353. "password": "",
  4354. "host": "",
  4355. "hostname": "",
  4356. "port": "",
  4357. "pathname": "/",
  4358. "search": "",
  4359. "hash": ""
  4360. },
  4361. {
  4362. "input": "data:/../",
  4363. "base": "about:blank",
  4364. "href": "data:/",
  4365. "origin": "null",
  4366. "protocol": "data:",
  4367. "username": "",
  4368. "password": "",
  4369. "host": "",
  4370. "hostname": "",
  4371. "port": "",
  4372. "pathname": "/",
  4373. "search": "",
  4374. "hash": ""
  4375. },
  4376. {
  4377. "input": "javascript:/../",
  4378. "base": "about:blank",
  4379. "href": "javascript:/",
  4380. "origin": "null",
  4381. "protocol": "javascript:",
  4382. "username": "",
  4383. "password": "",
  4384. "host": "",
  4385. "hostname": "",
  4386. "port": "",
  4387. "pathname": "/",
  4388. "search": "",
  4389. "hash": ""
  4390. },
  4391. {
  4392. "input": "mailto:/../",
  4393. "base": "about:blank",
  4394. "href": "mailto:/",
  4395. "origin": "null",
  4396. "protocol": "mailto:",
  4397. "username": "",
  4398. "password": "",
  4399. "host": "",
  4400. "hostname": "",
  4401. "port": "",
  4402. "pathname": "/",
  4403. "search": "",
  4404. "hash": ""
  4405. },
  4406. "# unknown schemes and their hosts",
  4407. {
  4408. "input": "sc://ñ.test/",
  4409. "base": "about:blank",
  4410. "href": "sc://%C3%B1.test/",
  4411. "origin": "null",
  4412. "protocol": "sc:",
  4413. "username": "",
  4414. "password": "",
  4415. "host": "%C3%B1.test",
  4416. "hostname": "%C3%B1.test",
  4417. "port": "",
  4418. "pathname": "/",
  4419. "search": "",
  4420. "hash": ""
  4421. },
  4422. {
  4423. "input": "sc://\u001F!\"$&'()*+,-.;<=>^_`{|}~/",
  4424. "base": "about:blank",
  4425. "href": "sc://%1F!\"$&'()*+,-.;<=>^_`{|}~/",
  4426. "origin": "null",
  4427. "protocol": "sc:",
  4428. "username": "",
  4429. "password": "",
  4430. "host": "%1F!\"$&'()*+,-.;<=>^_`{|}~",
  4431. "hostname": "%1F!\"$&'()*+,-.;<=>^_`{|}~",
  4432. "port": "",
  4433. "pathname": "/",
  4434. "search": "",
  4435. "hash": ""
  4436. },
  4437. {
  4438. "input": "sc://\u0000/",
  4439. "base": "about:blank",
  4440. "failure": true
  4441. },
  4442. {
  4443. "input": "sc:// /",
  4444. "base": "about:blank",
  4445. "failure": true
  4446. },
  4447. {
  4448. "input": "sc://%/",
  4449. "base": "about:blank",
  4450. "href": "sc://%/",
  4451. "protocol": "sc:",
  4452. "username": "",
  4453. "password": "",
  4454. "host": "%",
  4455. "hostname": "%",
  4456. "port": "",
  4457. "pathname": "/",
  4458. "search": "",
  4459. "hash": ""
  4460. },
  4461. {
  4462. "input": "sc://[/",
  4463. "base": "about:blank",
  4464. "failure": true
  4465. },
  4466. {
  4467. "input": "sc://\\/",
  4468. "base": "about:blank",
  4469. "failure": true
  4470. },
  4471. {
  4472. "input": "sc://]/",
  4473. "base": "about:blank",
  4474. "failure": true
  4475. },
  4476. {
  4477. "input": "x",
  4478. "base": "sc://ñ",
  4479. "href": "sc://%C3%B1/x",
  4480. "origin": "null",
  4481. "protocol": "sc:",
  4482. "username": "",
  4483. "password": "",
  4484. "host": "%C3%B1",
  4485. "hostname": "%C3%B1",
  4486. "port": "",
  4487. "pathname": "/x",
  4488. "search": "",
  4489. "hash": ""
  4490. },
  4491. "# unknown schemes and backslashes",
  4492. {
  4493. "input": "sc:\\../",
  4494. "base": "about:blank",
  4495. "href": "sc:\\../",
  4496. "origin": "null",
  4497. "protocol": "sc:",
  4498. "username": "",
  4499. "password": "",
  4500. "host": "",
  4501. "hostname": "",
  4502. "port": "",
  4503. "pathname": "\\../",
  4504. "search": "",
  4505. "hash": ""
  4506. },
  4507. "# unknown scheme with path looking like a password",
  4508. {
  4509. "input": "sc::a@example.net",
  4510. "base": "about:blank",
  4511. "href": "sc::a@example.net",
  4512. "origin": "null",
  4513. "protocol": "sc:",
  4514. "username": "",
  4515. "password": "",
  4516. "host": "",
  4517. "hostname": "",
  4518. "port": "",
  4519. "pathname": ":a@example.net",
  4520. "search": "",
  4521. "hash": ""
  4522. },
  4523. "# unknown scheme with bogus percent-encoding",
  4524. {
  4525. "input": "wow:%NBD",
  4526. "base": "about:blank",
  4527. "href": "wow:%NBD",
  4528. "origin": "null",
  4529. "protocol": "wow:",
  4530. "username": "",
  4531. "password": "",
  4532. "host": "",
  4533. "hostname": "",
  4534. "port": "",
  4535. "pathname": "%NBD",
  4536. "search": "",
  4537. "hash": ""
  4538. },
  4539. {
  4540. "input": "wow:%1G",
  4541. "base": "about:blank",
  4542. "href": "wow:%1G",
  4543. "origin": "null",
  4544. "protocol": "wow:",
  4545. "username": "",
  4546. "password": "",
  4547. "host": "",
  4548. "hostname": "",
  4549. "port": "",
  4550. "pathname": "%1G",
  4551. "search": "",
  4552. "hash": ""
  4553. },
  4554. "# Hosts and percent-encoding",
  4555. {
  4556. "input": "ftp://example.com%80/",
  4557. "base": "about:blank",
  4558. "failure": true
  4559. },
  4560. {
  4561. "input": "ftp://example.com%A0/",
  4562. "base": "about:blank",
  4563. "failure": true
  4564. },
  4565. {
  4566. "input": "https://example.com%80/",
  4567. "base": "about:blank",
  4568. "failure": true
  4569. },
  4570. {
  4571. "input": "https://example.com%A0/",
  4572. "base": "about:blank",
  4573. "failure": true
  4574. },
  4575. {
  4576. "input": "ftp://%e2%98%83",
  4577. "base": "about:blank",
  4578. "href": "ftp://xn--n3h/",
  4579. "origin": "ftp://xn--n3h",
  4580. "protocol": "ftp:",
  4581. "username": "",
  4582. "password": "",
  4583. "host": "xn--n3h",
  4584. "hostname": "xn--n3h",
  4585. "port": "",
  4586. "pathname": "/",
  4587. "search": "",
  4588. "hash": ""
  4589. },
  4590. {
  4591. "input": "https://%e2%98%83",
  4592. "base": "about:blank",
  4593. "href": "https://xn--n3h/",
  4594. "origin": "https://xn--n3h",
  4595. "protocol": "https:",
  4596. "username": "",
  4597. "password": "",
  4598. "host": "xn--n3h",
  4599. "hostname": "xn--n3h",
  4600. "port": "",
  4601. "pathname": "/",
  4602. "search": "",
  4603. "hash": ""
  4604. },
  4605. "# tests from jsdom/whatwg-url designed for code coverage",
  4606. {
  4607. "input": "http://127.0.0.1:10100/relative_import.html",
  4608. "base": "about:blank",
  4609. "href": "http://127.0.0.1:10100/relative_import.html",
  4610. "origin": "http://127.0.0.1:10100",
  4611. "protocol": "http:",
  4612. "username": "",
  4613. "password": "",
  4614. "host": "127.0.0.1:10100",
  4615. "hostname": "127.0.0.1",
  4616. "port": "10100",
  4617. "pathname": "/relative_import.html",
  4618. "search": "",
  4619. "hash": ""
  4620. },
  4621. {
  4622. "input": "http://facebook.com/?foo=%7B%22abc%22",
  4623. "base": "about:blank",
  4624. "href": "http://facebook.com/?foo=%7B%22abc%22",
  4625. "origin": "http://facebook.com",
  4626. "protocol": "http:",
  4627. "username": "",
  4628. "password": "",
  4629. "host": "facebook.com",
  4630. "hostname": "facebook.com",
  4631. "port": "",
  4632. "pathname": "/",
  4633. "search": "?foo=%7B%22abc%22",
  4634. "hash": ""
  4635. },
  4636. {
  4637. "input": "https://localhost:3000/jqueryui@1.2.3",
  4638. "base": "about:blank",
  4639. "href": "https://localhost:3000/jqueryui@1.2.3",
  4640. "origin": "https://localhost:3000",
  4641. "protocol": "https:",
  4642. "username": "",
  4643. "password": "",
  4644. "host": "localhost:3000",
  4645. "hostname": "localhost",
  4646. "port": "3000",
  4647. "pathname": "/jqueryui@1.2.3",
  4648. "search": "",
  4649. "hash": ""
  4650. },
  4651. "# tab/LF/CR",
  4652. {
  4653. "input": "h\tt\nt\rp://h\to\ns\rt:9\t0\n0\r0/p\ta\nt\rh?q\tu\ne\rry#f\tr\na\rg",
  4654. "base": "about:blank",
  4655. "href": "http://host:9000/path?query#frag",
  4656. "origin": "http://host:9000",
  4657. "protocol": "http:",
  4658. "username": "",
  4659. "password": "",
  4660. "host": "host:9000",
  4661. "hostname": "host",
  4662. "port": "9000",
  4663. "pathname": "/path",
  4664. "search": "?query",
  4665. "hash": "#frag"
  4666. },
  4667. "# Stringification of URL.searchParams",
  4668. {
  4669. "input": "?a=b&c=d",
  4670. "base": "http://example.org/foo/bar",
  4671. "href": "http://example.org/foo/bar?a=b&c=d",
  4672. "origin": "http://example.org",
  4673. "protocol": "http:",
  4674. "username": "",
  4675. "password": "",
  4676. "host": "example.org",
  4677. "hostname": "example.org",
  4678. "port": "",
  4679. "pathname": "/foo/bar",
  4680. "search": "?a=b&c=d",
  4681. "searchParams": "a=b&c=d",
  4682. "hash": ""
  4683. },
  4684. {
  4685. "input": "??a=b&c=d",
  4686. "base": "http://example.org/foo/bar",
  4687. "href": "http://example.org/foo/bar??a=b&c=d",
  4688. "origin": "http://example.org",
  4689. "protocol": "http:",
  4690. "username": "",
  4691. "password": "",
  4692. "host": "example.org",
  4693. "hostname": "example.org",
  4694. "port": "",
  4695. "pathname": "/foo/bar",
  4696. "search": "??a=b&c=d",
  4697. "searchParams": "%3Fa=b&c=d",
  4698. "hash": ""
  4699. },
  4700. "# Scheme only",
  4701. {
  4702. "input": "http:",
  4703. "base": "http://example.org/foo/bar",
  4704. "href": "http://example.org/foo/bar",
  4705. "origin": "http://example.org",
  4706. "protocol": "http:",
  4707. "username": "",
  4708. "password": "",
  4709. "host": "example.org",
  4710. "hostname": "example.org",
  4711. "port": "",
  4712. "pathname": "/foo/bar",
  4713. "search": "",
  4714. "searchParams": "",
  4715. "hash": ""
  4716. },
  4717. {
  4718. "input": "http:",
  4719. "base": "https://example.org/foo/bar",
  4720. "failure": true
  4721. },
  4722. {
  4723. "input": "sc:",
  4724. "base": "https://example.org/foo/bar",
  4725. "href": "sc:",
  4726. "origin": "null",
  4727. "protocol": "sc:",
  4728. "username": "",
  4729. "password": "",
  4730. "host": "",
  4731. "hostname": "",
  4732. "port": "",
  4733. "pathname": "",
  4734. "search": "",
  4735. "searchParams": "",
  4736. "hash": ""
  4737. },
  4738. "# Percent encoding of fragments",
  4739. {
  4740. "input": "http://foo.bar/baz?qux#foo\bbar",
  4741. "base": "about:blank",
  4742. "href": "http://foo.bar/baz?qux#foo%08bar",
  4743. "origin": "http://foo.bar",
  4744. "protocol": "http:",
  4745. "username": "",
  4746. "password": "",
  4747. "host": "foo.bar",
  4748. "hostname": "foo.bar",
  4749. "port": "",
  4750. "pathname": "/baz",
  4751. "search": "?qux",
  4752. "searchParams": "qux=",
  4753. "hash": "#foo%08bar"
  4754. },
  4755. "# IPv4 parsing (via https://github.com/nodejs/node/pull/10317)",
  4756. {
  4757. "input": "http://192.168.257",
  4758. "base": "http://other.com/",
  4759. "href": "http://192.168.1.1/",
  4760. "origin": "http://192.168.1.1",
  4761. "protocol": "http:",
  4762. "username": "",
  4763. "password": "",
  4764. "host": "192.168.1.1",
  4765. "hostname": "192.168.1.1",
  4766. "port": "",
  4767. "pathname": "/",
  4768. "search": "",
  4769. "hash": ""
  4770. },
  4771. {
  4772. "input": "http://192.168.257.com",
  4773. "base": "http://other.com/",
  4774. "href": "http://192.168.257.com/",
  4775. "origin": "http://192.168.257.com",
  4776. "protocol": "http:",
  4777. "username": "",
  4778. "password": "",
  4779. "host": "192.168.257.com",
  4780. "hostname": "192.168.257.com",
  4781. "port": "",
  4782. "pathname": "/",
  4783. "search": "",
  4784. "hash": ""
  4785. },
  4786. {
  4787. "input": "http://256",
  4788. "base": "http://other.com/",
  4789. "href": "http://0.0.1.0/",
  4790. "origin": "http://0.0.1.0",
  4791. "protocol": "http:",
  4792. "username": "",
  4793. "password": "",
  4794. "host": "0.0.1.0",
  4795. "hostname": "0.0.1.0",
  4796. "port": "",
  4797. "pathname": "/",
  4798. "search": "",
  4799. "hash": ""
  4800. },
  4801. {
  4802. "input": "http://256.com",
  4803. "base": "http://other.com/",
  4804. "href": "http://256.com/",
  4805. "origin": "http://256.com",
  4806. "protocol": "http:",
  4807. "username": "",
  4808. "password": "",
  4809. "host": "256.com",
  4810. "hostname": "256.com",
  4811. "port": "",
  4812. "pathname": "/",
  4813. "search": "",
  4814. "hash": ""
  4815. },
  4816. {
  4817. "input": "http://999999999",
  4818. "base": "http://other.com/",
  4819. "href": "http://59.154.201.255/",
  4820. "origin": "http://59.154.201.255",
  4821. "protocol": "http:",
  4822. "username": "",
  4823. "password": "",
  4824. "host": "59.154.201.255",
  4825. "hostname": "59.154.201.255",
  4826. "port": "",
  4827. "pathname": "/",
  4828. "search": "",
  4829. "hash": ""
  4830. },
  4831. {
  4832. "input": "http://999999999.com",
  4833. "base": "http://other.com/",
  4834. "href": "http://999999999.com/",
  4835. "origin": "http://999999999.com",
  4836. "protocol": "http:",
  4837. "username": "",
  4838. "password": "",
  4839. "host": "999999999.com",
  4840. "hostname": "999999999.com",
  4841. "port": "",
  4842. "pathname": "/",
  4843. "search": "",
  4844. "hash": ""
  4845. },
  4846. {
  4847. "input": "http://10000000000.com",
  4848. "base": "http://other.com/",
  4849. "href": "http://10000000000.com/",
  4850. "origin": "http://10000000000.com",
  4851. "protocol": "http:",
  4852. "username": "",
  4853. "password": "",
  4854. "host": "10000000000.com",
  4855. "hostname": "10000000000.com",
  4856. "port": "",
  4857. "pathname": "/",
  4858. "search": "",
  4859. "hash": ""
  4860. },
  4861. {
  4862. "input": "http://4294967295",
  4863. "base": "http://other.com/",
  4864. "href": "http://255.255.255.255/",
  4865. "origin": "http://255.255.255.255",
  4866. "protocol": "http:",
  4867. "username": "",
  4868. "password": "",
  4869. "host": "255.255.255.255",
  4870. "hostname": "255.255.255.255",
  4871. "port": "",
  4872. "pathname": "/",
  4873. "search": "",
  4874. "hash": ""
  4875. },
  4876. {
  4877. "input": "http://0xffffffff",
  4878. "base": "http://other.com/",
  4879. "href": "http://255.255.255.255/",
  4880. "origin": "http://255.255.255.255",
  4881. "protocol": "http:",
  4882. "username": "",
  4883. "password": "",
  4884. "host": "255.255.255.255",
  4885. "hostname": "255.255.255.255",
  4886. "port": "",
  4887. "pathname": "/",
  4888. "search": "",
  4889. "hash": ""
  4890. },
  4891. {
  4892. "input": "http://256.256.256.256",
  4893. "base": "http://other.com/",
  4894. "failure": true
  4895. },
  4896. {
  4897. "input": "http://256.256.256.256.256",
  4898. "base": "http://other.com/",
  4899. "href": "http://256.256.256.256.256/",
  4900. "origin": "http://256.256.256.256.256",
  4901. "protocol": "http:",
  4902. "username": "",
  4903. "password": "",
  4904. "host": "256.256.256.256.256",
  4905. "hostname": "256.256.256.256.256",
  4906. "port": "",
  4907. "pathname": "/",
  4908. "search": "",
  4909. "hash": ""
  4910. },
  4911. {
  4912. "input": "https://0x.0x.0",
  4913. "base": "about:blank",
  4914. "href": "https://0.0.0.0/",
  4915. "origin": "https://0.0.0.0",
  4916. "protocol": "https:",
  4917. "username": "",
  4918. "password": "",
  4919. "host": "0.0.0.0",
  4920. "hostname": "0.0.0.0",
  4921. "port": "",
  4922. "pathname": "/",
  4923. "search": "",
  4924. "hash": ""
  4925. },
  4926. "More IPv4 parsing (via https://github.com/jsdom/whatwg-url/issues/92)",
  4927. {
  4928. "input": "https://256.0.0.1/test",
  4929. "base": "about:blank",
  4930. "failure": true
  4931. },
  4932. "# file URLs containing percent-encoded Windows drive letters (shouldn't work)",
  4933. {
  4934. "input": "file:///C%3A/",
  4935. "base": "about:blank",
  4936. "href": "file:///C%3A/",
  4937. "protocol": "file:",
  4938. "username": "",
  4939. "password": "",
  4940. "host": "",
  4941. "hostname": "",
  4942. "port": "",
  4943. "pathname": "/C%3A/",
  4944. "search": "",
  4945. "hash": ""
  4946. },
  4947. {
  4948. "input": "file:///C%7C/",
  4949. "base": "about:blank",
  4950. "href": "file:///C%7C/",
  4951. "protocol": "file:",
  4952. "username": "",
  4953. "password": "",
  4954. "host": "",
  4955. "hostname": "",
  4956. "port": "",
  4957. "pathname": "/C%7C/",
  4958. "search": "",
  4959. "hash": ""
  4960. },
  4961. "# file URLs relative to other file URLs (via https://github.com/jsdom/whatwg-url/pull/60)",
  4962. {
  4963. "input": "pix/submit.gif",
  4964. "base": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html",
  4965. "href": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
  4966. "protocol": "file:",
  4967. "username": "",
  4968. "password": "",
  4969. "host": "",
  4970. "hostname": "",
  4971. "port": "",
  4972. "pathname": "/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
  4973. "search": "",
  4974. "hash": ""
  4975. },
  4976. {
  4977. "input": "..",
  4978. "base": "file:///C:/",
  4979. "href": "file:///C:/",
  4980. "protocol": "file:",
  4981. "username": "",
  4982. "password": "",
  4983. "host": "",
  4984. "hostname": "",
  4985. "port": "",
  4986. "pathname": "/C:/",
  4987. "search": "",
  4988. "hash": ""
  4989. },
  4990. {
  4991. "input": "..",
  4992. "base": "file:///",
  4993. "href": "file:///",
  4994. "protocol": "file:",
  4995. "username": "",
  4996. "password": "",
  4997. "host": "",
  4998. "hostname": "",
  4999. "port": "",
  5000. "pathname": "/",
  5001. "search": "",
  5002. "hash": ""
  5003. },
  5004. "# More file URL tests by zcorpan and annevk",
  5005. {
  5006. "input": "/",
  5007. "base": "file:///C:/a/b",
  5008. "href": "file:///C:/",
  5009. "protocol": "file:",
  5010. "username": "",
  5011. "password": "",
  5012. "host": "",
  5013. "hostname": "",
  5014. "port": "",
  5015. "pathname": "/C:/",
  5016. "search": "",
  5017. "hash": ""
  5018. },
  5019. {
  5020. "input": "//d:",
  5021. "base": "file:///C:/a/b",
  5022. "href": "file:///d:",
  5023. "protocol": "file:",
  5024. "username": "",
  5025. "password": "",
  5026. "host": "",
  5027. "hostname": "",
  5028. "port": "",
  5029. "pathname": "/d:",
  5030. "search": "",
  5031. "hash": ""
  5032. },
  5033. {
  5034. "input": "//d:/..",
  5035. "base": "file:///C:/a/b",
  5036. "href": "file:///d:/",
  5037. "protocol": "file:",
  5038. "username": "",
  5039. "password": "",
  5040. "host": "",
  5041. "hostname": "",
  5042. "port": "",
  5043. "pathname": "/d:/",
  5044. "search": "",
  5045. "hash": ""
  5046. },
  5047. {
  5048. "input": "..",
  5049. "base": "file:///ab:/",
  5050. "href": "file:///",
  5051. "protocol": "file:",
  5052. "username": "",
  5053. "password": "",
  5054. "host": "",
  5055. "hostname": "",
  5056. "port": "",
  5057. "pathname": "/",
  5058. "search": "",
  5059. "hash": ""
  5060. },
  5061. {
  5062. "input": "..",
  5063. "base": "file:///1:/",
  5064. "href": "file:///",
  5065. "protocol": "file:",
  5066. "username": "",
  5067. "password": "",
  5068. "host": "",
  5069. "hostname": "",
  5070. "port": "",
  5071. "pathname": "/",
  5072. "search": "",
  5073. "hash": ""
  5074. },
  5075. {
  5076. "input": "",
  5077. "base": "file:///test?test#test",
  5078. "href": "file:///test?test",
  5079. "protocol": "file:",
  5080. "username": "",
  5081. "password": "",
  5082. "host": "",
  5083. "hostname": "",
  5084. "port": "",
  5085. "pathname": "/test",
  5086. "search": "?test",
  5087. "hash": ""
  5088. },
  5089. {
  5090. "input": "file:",
  5091. "base": "file:///test?test#test",
  5092. "href": "file:///test?test",
  5093. "protocol": "file:",
  5094. "username": "",
  5095. "password": "",
  5096. "host": "",
  5097. "hostname": "",
  5098. "port": "",
  5099. "pathname": "/test",
  5100. "search": "?test",
  5101. "hash": ""
  5102. },
  5103. {
  5104. "input": "?x",
  5105. "base": "file:///test?test#test",
  5106. "href": "file:///test?x",
  5107. "protocol": "file:",
  5108. "username": "",
  5109. "password": "",
  5110. "host": "",
  5111. "hostname": "",
  5112. "port": "",
  5113. "pathname": "/test",
  5114. "search": "?x",
  5115. "hash": ""
  5116. },
  5117. {
  5118. "input": "file:?x",
  5119. "base": "file:///test?test#test",
  5120. "href": "file:///test?x",
  5121. "protocol": "file:",
  5122. "username": "",
  5123. "password": "",
  5124. "host": "",
  5125. "hostname": "",
  5126. "port": "",
  5127. "pathname": "/test",
  5128. "search": "?x",
  5129. "hash": ""
  5130. },
  5131. {
  5132. "input": "#x",
  5133. "base": "file:///test?test#test",
  5134. "href": "file:///test?test#x",
  5135. "protocol": "file:",
  5136. "username": "",
  5137. "password": "",
  5138. "host": "",
  5139. "hostname": "",
  5140. "port": "",
  5141. "pathname": "/test",
  5142. "search": "?test",
  5143. "hash": "#x"
  5144. },
  5145. {
  5146. "input": "file:#x",
  5147. "base": "file:///test?test#test",
  5148. "href": "file:///test?test#x",
  5149. "protocol": "file:",
  5150. "username": "",
  5151. "password": "",
  5152. "host": "",
  5153. "hostname": "",
  5154. "port": "",
  5155. "pathname": "/test",
  5156. "search": "?test",
  5157. "hash": "#x"
  5158. },
  5159. "# File URLs and many (back)slashes",
  5160. {
  5161. "input": "file:///localhost//cat",
  5162. "base": "about:blank",
  5163. "href": "file:///localhost//cat",
  5164. "protocol": "file:",
  5165. "username": "",
  5166. "password": "",
  5167. "host": "",
  5168. "hostname": "",
  5169. "port": "",
  5170. "pathname": "/localhost//cat",
  5171. "search": "",
  5172. "hash": ""
  5173. },
  5174. {
  5175. "input": "\\//pig",
  5176. "base": "file://lion/",
  5177. "href": "file:///pig",
  5178. "protocol": "file:",
  5179. "username": "",
  5180. "password": "",
  5181. "host": "",
  5182. "hostname": "",
  5183. "port": "",
  5184. "pathname": "/pig",
  5185. "search": "",
  5186. "hash": ""
  5187. },
  5188. {
  5189. "input": "file://",
  5190. "base": "file://ape/",
  5191. "href": "file:///",
  5192. "protocol": "file:",
  5193. "username": "",
  5194. "password": "",
  5195. "host": "",
  5196. "hostname": "",
  5197. "port": "",
  5198. "pathname": "/",
  5199. "search": "",
  5200. "hash": ""
  5201. },
  5202. "# Windows drive letter handling with the 'file:' base URL",
  5203. {
  5204. "input": "C|#",
  5205. "base": "file://host/dir/file",
  5206. "href": "file:///C:#",
  5207. "protocol": "file:",
  5208. "username": "",
  5209. "password": "",
  5210. "host": "",
  5211. "hostname": "",
  5212. "port": "",
  5213. "pathname": "/C:",
  5214. "search": "",
  5215. "hash": ""
  5216. },
  5217. {
  5218. "input": "C|?",
  5219. "base": "file://host/dir/file",
  5220. "href": "file:///C:?",
  5221. "protocol": "file:",
  5222. "username": "",
  5223. "password": "",
  5224. "host": "",
  5225. "hostname": "",
  5226. "port": "",
  5227. "pathname": "/C:",
  5228. "search": "",
  5229. "hash": ""
  5230. },
  5231. {
  5232. "input": "C|/",
  5233. "base": "file://host/dir/file",
  5234. "href": "file:///C:/",
  5235. "protocol": "file:",
  5236. "username": "",
  5237. "password": "",
  5238. "host": "",
  5239. "hostname": "",
  5240. "port": "",
  5241. "pathname": "/C:/",
  5242. "search": "",
  5243. "hash": ""
  5244. },
  5245. {
  5246. "input": "C|\n/",
  5247. "base": "file://host/dir/file",
  5248. "href": "file:///C:/",
  5249. "protocol": "file:",
  5250. "username": "",
  5251. "password": "",
  5252. "host": "",
  5253. "hostname": "",
  5254. "port": "",
  5255. "pathname": "/C:/",
  5256. "search": "",
  5257. "hash": ""
  5258. },
  5259. {
  5260. "input": "C|\\",
  5261. "base": "file://host/dir/file",
  5262. "href": "file:///C:/",
  5263. "protocol": "file:",
  5264. "username": "",
  5265. "password": "",
  5266. "host": "",
  5267. "hostname": "",
  5268. "port": "",
  5269. "pathname": "/C:/",
  5270. "search": "",
  5271. "hash": ""
  5272. },
  5273. {
  5274. "input": "C",
  5275. "base": "file://host/dir/file",
  5276. "href": "file://host/dir/C",
  5277. "protocol": "file:",
  5278. "username": "",
  5279. "password": "",
  5280. "host": "host",
  5281. "hostname": "host",
  5282. "port": "",
  5283. "pathname": "/dir/C",
  5284. "search": "",
  5285. "hash": ""
  5286. },
  5287. {
  5288. "input": "C|a",
  5289. "base": "file://host/dir/file",
  5290. "href": "file://host/dir/C|a",
  5291. "protocol": "file:",
  5292. "username": "",
  5293. "password": "",
  5294. "host": "host",
  5295. "hostname": "host",
  5296. "port": "",
  5297. "pathname": "/dir/C|a",
  5298. "search": "",
  5299. "hash": ""
  5300. },
  5301. "# Windows drive letter quirk in the file slash state",
  5302. {
  5303. "input": "/c:/foo/bar",
  5304. "base": "file://host/path",
  5305. "href": "file:///c:/foo/bar",
  5306. "protocol": "file:",
  5307. "username": "",
  5308. "password": "",
  5309. "host": "",
  5310. "hostname": "",
  5311. "port": "",
  5312. "pathname": "/c:/foo/bar",
  5313. "search": "",
  5314. "hash": ""
  5315. },
  5316. "# Windows drive letter quirk (no host)",
  5317. {
  5318. "input": "file:/C|/",
  5319. "base": "about:blank",
  5320. "href": "file:///C:/",
  5321. "protocol": "file:",
  5322. "username": "",
  5323. "password": "",
  5324. "host": "",
  5325. "hostname": "",
  5326. "port": "",
  5327. "pathname": "/C:/",
  5328. "search": "",
  5329. "hash": ""
  5330. },
  5331. {
  5332. "input": "file://C|/",
  5333. "base": "about:blank",
  5334. "href": "file:///C:/",
  5335. "protocol": "file:",
  5336. "username": "",
  5337. "password": "",
  5338. "host": "",
  5339. "hostname": "",
  5340. "port": "",
  5341. "pathname": "/C:/",
  5342. "search": "",
  5343. "hash": ""
  5344. },
  5345. "# file URLs without base URL by Rimas Misevičius",
  5346. {
  5347. "input": "file:",
  5348. "base": "about:blank",
  5349. "href": "file:///",
  5350. "protocol": "file:",
  5351. "username": "",
  5352. "password": "",
  5353. "host": "",
  5354. "hostname": "",
  5355. "port": "",
  5356. "pathname": "/",
  5357. "search": "",
  5358. "hash": ""
  5359. },
  5360. {
  5361. "input": "file:?q=v",
  5362. "base": "about:blank",
  5363. "href": "file:///?q=v",
  5364. "protocol": "file:",
  5365. "username": "",
  5366. "password": "",
  5367. "host": "",
  5368. "hostname": "",
  5369. "port": "",
  5370. "pathname": "/",
  5371. "search": "?q=v",
  5372. "hash": ""
  5373. },
  5374. {
  5375. "input": "file:#frag",
  5376. "base": "about:blank",
  5377. "href": "file:///#frag",
  5378. "protocol": "file:",
  5379. "username": "",
  5380. "password": "",
  5381. "host": "",
  5382. "hostname": "",
  5383. "port": "",
  5384. "pathname": "/",
  5385. "search": "",
  5386. "hash": "#frag"
  5387. },
  5388. "# IPv6 tests",
  5389. {
  5390. "input": "http://[1:0::]",
  5391. "base": "http://example.net/",
  5392. "href": "http://[1::]/",
  5393. "origin": "http://[1::]",
  5394. "protocol": "http:",
  5395. "username": "",
  5396. "password": "",
  5397. "host": "[1::]",
  5398. "hostname": "[1::]",
  5399. "port": "",
  5400. "pathname": "/",
  5401. "search": "",
  5402. "hash": ""
  5403. },
  5404. {
  5405. "input": "http://[0:1:2:3:4:5:6:7:8]",
  5406. "base": "http://example.net/",
  5407. "failure": true
  5408. },
  5409. {
  5410. "input": "https://[0::0::0]",
  5411. "base": "about:blank",
  5412. "failure": true
  5413. },
  5414. {
  5415. "input": "https://[0:.0]",
  5416. "base": "about:blank",
  5417. "failure": true
  5418. },
  5419. {
  5420. "input": "https://[0:0:]",
  5421. "base": "about:blank",
  5422. "failure": true
  5423. },
  5424. {
  5425. "input": "https://[0:1:2:3:4:5:6:7.0.0.0.1]",
  5426. "base": "about:blank",
  5427. "failure": true
  5428. },
  5429. {
  5430. "input": "https://[0:1.00.0.0.0]",
  5431. "base": "about:blank",
  5432. "failure": true
  5433. },
  5434. {
  5435. "input": "https://[0:1.290.0.0.0]",
  5436. "base": "about:blank",
  5437. "failure": true
  5438. },
  5439. {
  5440. "input": "https://[0:1.23.23]",
  5441. "base": "about:blank",
  5442. "failure": true
  5443. },
  5444. "# Empty host",
  5445. {
  5446. "input": "http://?",
  5447. "base": "about:blank",
  5448. "failure": true
  5449. },
  5450. {
  5451. "input": "http://#",
  5452. "base": "about:blank",
  5453. "failure": true
  5454. },
  5455. "Port overflow (2^32 + 81)",
  5456. {
  5457. "input": "http://f:4294967377/c",
  5458. "base": "http://example.org/",
  5459. "failure": true
  5460. },
  5461. "Port overflow (2^64 + 81)",
  5462. {
  5463. "input": "http://f:18446744073709551697/c",
  5464. "base": "http://example.org/",
  5465. "failure": true
  5466. },
  5467. "Port overflow (2^128 + 81)",
  5468. {
  5469. "input": "http://f:340282366920938463463374607431768211537/c",
  5470. "base": "http://example.org/",
  5471. "failure": true
  5472. },
  5473. "# Non-special-URL path tests",
  5474. {
  5475. "input": "///",
  5476. "base": "sc://x/",
  5477. "href": "sc:///",
  5478. "protocol": "sc:",
  5479. "username": "",
  5480. "password": "",
  5481. "host": "",
  5482. "hostname": "",
  5483. "port": "",
  5484. "pathname": "/",
  5485. "search": "",
  5486. "hash": ""
  5487. },
  5488. {
  5489. "input": "tftp://foobar.com/someconfig;mode=netascii",
  5490. "base": "about:blank",
  5491. "href": "tftp://foobar.com/someconfig;mode=netascii",
  5492. "origin": "null",
  5493. "protocol": "tftp:",
  5494. "username": "",
  5495. "password": "",
  5496. "host": "foobar.com",
  5497. "hostname": "foobar.com",
  5498. "port": "",
  5499. "pathname": "/someconfig;mode=netascii",
  5500. "search": "",
  5501. "hash": ""
  5502. },
  5503. {
  5504. "input": "telnet://user:pass@foobar.com:23/",
  5505. "base": "about:blank",
  5506. "href": "telnet://user:pass@foobar.com:23/",
  5507. "origin": "null",
  5508. "protocol": "telnet:",
  5509. "username": "user",
  5510. "password": "pass",
  5511. "host": "foobar.com:23",
  5512. "hostname": "foobar.com",
  5513. "port": "23",
  5514. "pathname": "/",
  5515. "search": "",
  5516. "hash": ""
  5517. },
  5518. {
  5519. "input": "ut2004://10.10.10.10:7777/Index.ut2",
  5520. "base": "about:blank",
  5521. "href": "ut2004://10.10.10.10:7777/Index.ut2",
  5522. "origin": "null",
  5523. "protocol": "ut2004:",
  5524. "username": "",
  5525. "password": "",
  5526. "host": "10.10.10.10:7777",
  5527. "hostname": "10.10.10.10",
  5528. "port": "7777",
  5529. "pathname": "/Index.ut2",
  5530. "search": "",
  5531. "hash": ""
  5532. },
  5533. {
  5534. "input": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz",
  5535. "base": "about:blank",
  5536. "href": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz",
  5537. "origin": "null",
  5538. "protocol": "redis:",
  5539. "username": "foo",
  5540. "password": "bar",
  5541. "host": "somehost:6379",
  5542. "hostname": "somehost",
  5543. "port": "6379",
  5544. "pathname": "/0",
  5545. "search": "?baz=bam&qux=baz",
  5546. "hash": ""
  5547. },
  5548. {
  5549. "input": "rsync://foo@host:911/sup",
  5550. "base": "about:blank",
  5551. "href": "rsync://foo@host:911/sup",
  5552. "origin": "null",
  5553. "protocol": "rsync:",
  5554. "username": "foo",
  5555. "password": "",
  5556. "host": "host:911",
  5557. "hostname": "host",
  5558. "port": "911",
  5559. "pathname": "/sup",
  5560. "search": "",
  5561. "hash": ""
  5562. },
  5563. {
  5564. "input": "git://github.com/foo/bar.git",
  5565. "base": "about:blank",
  5566. "href": "git://github.com/foo/bar.git",
  5567. "origin": "null",
  5568. "protocol": "git:",
  5569. "username": "",
  5570. "password": "",
  5571. "host": "github.com",
  5572. "hostname": "github.com",
  5573. "port": "",
  5574. "pathname": "/foo/bar.git",
  5575. "search": "",
  5576. "hash": ""
  5577. },
  5578. {
  5579. "input": "irc://myserver.com:6999/channel?passwd",
  5580. "base": "about:blank",
  5581. "href": "irc://myserver.com:6999/channel?passwd",
  5582. "origin": "null",
  5583. "protocol": "irc:",
  5584. "username": "",
  5585. "password": "",
  5586. "host": "myserver.com:6999",
  5587. "hostname": "myserver.com",
  5588. "port": "6999",
  5589. "pathname": "/channel",
  5590. "search": "?passwd",
  5591. "hash": ""
  5592. },
  5593. {
  5594. "input": "dns://fw.example.org:9999/foo.bar.org?type=TXT",
  5595. "base": "about:blank",
  5596. "href": "dns://fw.example.org:9999/foo.bar.org?type=TXT",
  5597. "origin": "null",
  5598. "protocol": "dns:",
  5599. "username": "",
  5600. "password": "",
  5601. "host": "fw.example.org:9999",
  5602. "hostname": "fw.example.org",
  5603. "port": "9999",
  5604. "pathname": "/foo.bar.org",
  5605. "search": "?type=TXT",
  5606. "hash": ""
  5607. },
  5608. {
  5609. "input": "ldap://localhost:389/ou=People,o=JNDITutorial",
  5610. "base": "about:blank",
  5611. "href": "ldap://localhost:389/ou=People,o=JNDITutorial",
  5612. "origin": "null",
  5613. "protocol": "ldap:",
  5614. "username": "",
  5615. "password": "",
  5616. "host": "localhost:389",
  5617. "hostname": "localhost",
  5618. "port": "389",
  5619. "pathname": "/ou=People,o=JNDITutorial",
  5620. "search": "",
  5621. "hash": ""
  5622. },
  5623. {
  5624. "input": "git+https://github.com/foo/bar",
  5625. "base": "about:blank",
  5626. "href": "git+https://github.com/foo/bar",
  5627. "origin": "null",
  5628. "protocol": "git+https:",
  5629. "username": "",
  5630. "password": "",
  5631. "host": "github.com",
  5632. "hostname": "github.com",
  5633. "port": "",
  5634. "pathname": "/foo/bar",
  5635. "search": "",
  5636. "hash": ""
  5637. },
  5638. {
  5639. "input": "urn:ietf:rfc:2648",
  5640. "base": "about:blank",
  5641. "href": "urn:ietf:rfc:2648",
  5642. "origin": "null",
  5643. "protocol": "urn:",
  5644. "username": "",
  5645. "password": "",
  5646. "host": "",
  5647. "hostname": "",
  5648. "port": "",
  5649. "pathname": "ietf:rfc:2648",
  5650. "search": "",
  5651. "hash": ""
  5652. },
  5653. {
  5654. "input": "tag:joe@example.org,2001:foo/bar",
  5655. "base": "about:blank",
  5656. "href": "tag:joe@example.org,2001:foo/bar",
  5657. "origin": "null",
  5658. "protocol": "tag:",
  5659. "username": "",
  5660. "password": "",
  5661. "host": "",
  5662. "hostname": "",
  5663. "port": "",
  5664. "pathname": "joe@example.org,2001:foo/bar",
  5665. "search": "",
  5666. "hash": ""
  5667. },
  5668. "# percent encoded hosts in non-special-URLs",
  5669. {
  5670. "input": "non-special://%E2%80%A0/",
  5671. "base": "about:blank",
  5672. "href": "non-special://%E2%80%A0/",
  5673. "protocol": "non-special:",
  5674. "username": "",
  5675. "password": "",
  5676. "host": "%E2%80%A0",
  5677. "hostname": "%E2%80%A0",
  5678. "port": "",
  5679. "pathname": "/",
  5680. "search": "",
  5681. "hash": ""
  5682. },
  5683. {
  5684. "input": "non-special://H%4fSt/path",
  5685. "base": "about:blank",
  5686. "href": "non-special://H%4fSt/path",
  5687. "protocol": "non-special:",
  5688. "username": "",
  5689. "password": "",
  5690. "host": "H%4fSt",
  5691. "hostname": "H%4fSt",
  5692. "port": "",
  5693. "pathname": "/path",
  5694. "search": "",
  5695. "hash": ""
  5696. },
  5697. "# IPv6 in non-special-URLs",
  5698. {
  5699. "input": "non-special://[1:2:0:0:5:0:0:0]/",
  5700. "base": "about:blank",
  5701. "href": "non-special://[1:2:0:0:5::]/",
  5702. "protocol": "non-special:",
  5703. "username": "",
  5704. "password": "",
  5705. "host": "[1:2:0:0:5::]",
  5706. "hostname": "[1:2:0:0:5::]",
  5707. "port": "",
  5708. "pathname": "/",
  5709. "search": "",
  5710. "hash": ""
  5711. },
  5712. {
  5713. "input": "non-special://[1:2:0:0:0:0:0:3]/",
  5714. "base": "about:blank",
  5715. "href": "non-special://[1:2::3]/",
  5716. "protocol": "non-special:",
  5717. "username": "",
  5718. "password": "",
  5719. "host": "[1:2::3]",
  5720. "hostname": "[1:2::3]",
  5721. "port": "",
  5722. "pathname": "/",
  5723. "search": "",
  5724. "hash": ""
  5725. },
  5726. {
  5727. "input": "non-special://[1:2::3]:80/",
  5728. "base": "about:blank",
  5729. "href": "non-special://[1:2::3]:80/",
  5730. "protocol": "non-special:",
  5731. "username": "",
  5732. "password": "",
  5733. "host": "[1:2::3]:80",
  5734. "hostname": "[1:2::3]",
  5735. "port": "80",
  5736. "pathname": "/",
  5737. "search": "",
  5738. "hash": ""
  5739. },
  5740. {
  5741. "input": "non-special://[:80/",
  5742. "base": "about:blank",
  5743. "failure": true
  5744. },
  5745. {
  5746. "input": "blob:https://example.com:443/",
  5747. "base": "about:blank",
  5748. "href": "blob:https://example.com:443/",
  5749. "protocol": "blob:",
  5750. "username": "",
  5751. "password": "",
  5752. "host": "",
  5753. "hostname": "",
  5754. "port": "",
  5755. "pathname": "https://example.com:443/",
  5756. "search": "",
  5757. "hash": ""
  5758. },
  5759. {
  5760. "input": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
  5761. "base": "about:blank",
  5762. "href": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
  5763. "protocol": "blob:",
  5764. "username": "",
  5765. "password": "",
  5766. "host": "",
  5767. "hostname": "",
  5768. "port": "",
  5769. "pathname": "d3958f5c-0777-0845-9dcf-2cb28783acaf",
  5770. "search": "",
  5771. "hash": ""
  5772. },
  5773. "Invalid IPv4 radix digits",
  5774. {
  5775. "input": "http://0177.0.0.0189",
  5776. "base": "about:blank",
  5777. "href": "http://0177.0.0.0189/",
  5778. "protocol": "http:",
  5779. "username": "",
  5780. "password": "",
  5781. "host": "0177.0.0.0189",
  5782. "hostname": "0177.0.0.0189",
  5783. "port": "",
  5784. "pathname": "/",
  5785. "search": "",
  5786. "hash": ""
  5787. },
  5788. {
  5789. "input": "http://0x7f.0.0.0x7g",
  5790. "base": "about:blank",
  5791. "href": "http://0x7f.0.0.0x7g/",
  5792. "protocol": "http:",
  5793. "username": "",
  5794. "password": "",
  5795. "host": "0x7f.0.0.0x7g",
  5796. "hostname": "0x7f.0.0.0x7g",
  5797. "port": "",
  5798. "pathname": "/",
  5799. "search": "",
  5800. "hash": ""
  5801. },
  5802. {
  5803. "input": "http://0X7F.0.0.0X7G",
  5804. "base": "about:blank",
  5805. "href": "http://0x7f.0.0.0x7g/",
  5806. "protocol": "http:",
  5807. "username": "",
  5808. "password": "",
  5809. "host": "0x7f.0.0.0x7g",
  5810. "hostname": "0x7f.0.0.0x7g",
  5811. "port": "",
  5812. "pathname": "/",
  5813. "search": "",
  5814. "hash": ""
  5815. },
  5816. "Invalid IPv4 portion of IPv6 address",
  5817. {
  5818. "input": "http://[::127.0.0.0.1]",
  5819. "base": "about:blank",
  5820. "failure": true
  5821. },
  5822. "Uncompressed IPv6 addresses with 0",
  5823. {
  5824. "input": "http://[0:1:0:1:0:1:0:1]",
  5825. "base": "about:blank",
  5826. "href": "http://[0:1:0:1:0:1:0:1]/",
  5827. "protocol": "http:",
  5828. "username": "",
  5829. "password": "",
  5830. "host": "[0:1:0:1:0:1:0:1]",
  5831. "hostname": "[0:1:0:1:0:1:0:1]",
  5832. "port": "",
  5833. "pathname": "/",
  5834. "search": "",
  5835. "hash": ""
  5836. },
  5837. {
  5838. "input": "http://[1:0:1:0:1:0:1:0]",
  5839. "base": "about:blank",
  5840. "href": "http://[1:0:1:0:1:0:1:0]/",
  5841. "protocol": "http:",
  5842. "username": "",
  5843. "password": "",
  5844. "host": "[1:0:1:0:1:0:1:0]",
  5845. "hostname": "[1:0:1:0:1:0:1:0]",
  5846. "port": "",
  5847. "pathname": "/",
  5848. "search": "",
  5849. "hash": ""
  5850. },
  5851. "Percent-encoded query and fragment",
  5852. {
  5853. "input": "http://example.org/test?\u0022",
  5854. "base": "about:blank",
  5855. "href": "http://example.org/test?%22",
  5856. "protocol": "http:",
  5857. "username": "",
  5858. "password": "",
  5859. "host": "example.org",
  5860. "hostname": "example.org",
  5861. "port": "",
  5862. "pathname": "/test",
  5863. "search": "?%22",
  5864. "hash": ""
  5865. },
  5866. {
  5867. "input": "http://example.org/test?\u0023",
  5868. "base": "about:blank",
  5869. "href": "http://example.org/test?#",
  5870. "protocol": "http:",
  5871. "username": "",
  5872. "password": "",
  5873. "host": "example.org",
  5874. "hostname": "example.org",
  5875. "port": "",
  5876. "pathname": "/test",
  5877. "search": "",
  5878. "hash": ""
  5879. },
  5880. {
  5881. "input": "http://example.org/test?\u003C",
  5882. "base": "about:blank",
  5883. "href": "http://example.org/test?%3C",
  5884. "protocol": "http:",
  5885. "username": "",
  5886. "password": "",
  5887. "host": "example.org",
  5888. "hostname": "example.org",
  5889. "port": "",
  5890. "pathname": "/test",
  5891. "search": "?%3C",
  5892. "hash": ""
  5893. },
  5894. {
  5895. "input": "http://example.org/test?\u003E",
  5896. "base": "about:blank",
  5897. "href": "http://example.org/test?%3E",
  5898. "protocol": "http:",
  5899. "username": "",
  5900. "password": "",
  5901. "host": "example.org",
  5902. "hostname": "example.org",
  5903. "port": "",
  5904. "pathname": "/test",
  5905. "search": "?%3E",
  5906. "hash": ""
  5907. },
  5908. {
  5909. "input": "http://example.org/test?\u2323",
  5910. "base": "about:blank",
  5911. "href": "http://example.org/test?%E2%8C%A3",
  5912. "protocol": "http:",
  5913. "username": "",
  5914. "password": "",
  5915. "host": "example.org",
  5916. "hostname": "example.org",
  5917. "port": "",
  5918. "pathname": "/test",
  5919. "search": "?%E2%8C%A3",
  5920. "hash": ""
  5921. },
  5922. {
  5923. "input": "http://example.org/test?%23%23",
  5924. "base": "about:blank",
  5925. "href": "http://example.org/test?%23%23",
  5926. "protocol": "http:",
  5927. "username": "",
  5928. "password": "",
  5929. "host": "example.org",
  5930. "hostname": "example.org",
  5931. "port": "",
  5932. "pathname": "/test",
  5933. "search": "?%23%23",
  5934. "hash": ""
  5935. },
  5936. {
  5937. "input": "http://example.org/test?%GH",
  5938. "base": "about:blank",
  5939. "href": "http://example.org/test?%GH",
  5940. "protocol": "http:",
  5941. "username": "",
  5942. "password": "",
  5943. "host": "example.org",
  5944. "hostname": "example.org",
  5945. "port": "",
  5946. "pathname": "/test",
  5947. "search": "?%GH",
  5948. "hash": ""
  5949. },
  5950. {
  5951. "input": "http://example.org/test?a#%EF",
  5952. "base": "about:blank",
  5953. "href": "http://example.org/test?a#%EF",
  5954. "protocol": "http:",
  5955. "username": "",
  5956. "password": "",
  5957. "host": "example.org",
  5958. "hostname": "example.org",
  5959. "port": "",
  5960. "pathname": "/test",
  5961. "search": "?a",
  5962. "hash": "#%EF"
  5963. },
  5964. {
  5965. "input": "http://example.org/test?a#%GH",
  5966. "base": "about:blank",
  5967. "href": "http://example.org/test?a#%GH",
  5968. "protocol": "http:",
  5969. "username": "",
  5970. "password": "",
  5971. "host": "example.org",
  5972. "hostname": "example.org",
  5973. "port": "",
  5974. "pathname": "/test",
  5975. "search": "?a",
  5976. "hash": "#%GH"
  5977. },
  5978. "Bad bases",
  5979. {
  5980. "input": "test-a.html",
  5981. "base": "a",
  5982. "failure": true
  5983. },
  5984. {
  5985. "input": "test-a-slash.html",
  5986. "base": "a/",
  5987. "failure": true
  5988. },
  5989. {
  5990. "input": "test-a-slash-slash.html",
  5991. "base": "a//",
  5992. "failure": true
  5993. },
  5994. {
  5995. "input": "test-a-colon.html",
  5996. "base": "a:",
  5997. "failure": true
  5998. },
  5999. {
  6000. "input": "test-a-colon-slash.html",
  6001. "base": "a:/",
  6002. "href": "a:/test-a-colon-slash.html",
  6003. "protocol": "a:",
  6004. "username": "",
  6005. "password": "",
  6006. "host": "",
  6007. "hostname": "",
  6008. "port": "",
  6009. "pathname": "/test-a-colon-slash.html",
  6010. "search": "",
  6011. "hash": ""
  6012. },
  6013. {
  6014. "input": "test-a-colon-slash-slash.html",
  6015. "base": "a://",
  6016. "href": "a:///test-a-colon-slash-slash.html",
  6017. "protocol": "a:",
  6018. "username": "",
  6019. "password": "",
  6020. "host": "",
  6021. "hostname": "",
  6022. "port": "",
  6023. "pathname": "/test-a-colon-slash-slash.html",
  6024. "search": "",
  6025. "hash": ""
  6026. },
  6027. {
  6028. "input": "test-a-colon-b.html",
  6029. "base": "a:b",
  6030. "failure": true
  6031. },
  6032. {
  6033. "input": "test-a-colon-slash-b.html",
  6034. "base": "a:/b",
  6035. "href": "a:/test-a-colon-slash-b.html",
  6036. "protocol": "a:",
  6037. "username": "",
  6038. "password": "",
  6039. "host": "",
  6040. "hostname": "",
  6041. "port": "",
  6042. "pathname": "/test-a-colon-slash-b.html",
  6043. "search": "",
  6044. "hash": ""
  6045. },
  6046. {
  6047. "input": "test-a-colon-slash-slash-b.html",
  6048. "base": "a://b",
  6049. "href": "a://b/test-a-colon-slash-slash-b.html",
  6050. "protocol": "a:",
  6051. "username": "",
  6052. "password": "",
  6053. "host": "b",
  6054. "hostname": "b",
  6055. "port": "",
  6056. "pathname": "/test-a-colon-slash-slash-b.html",
  6057. "search": "",
  6058. "hash": ""
  6059. },
  6060. "Null code point in fragment",
  6061. {
  6062. "input": "http://example.org/test?a#b\u0000c",
  6063. "base": "about:blank",
  6064. "href": "http://example.org/test?a#bc",
  6065. "protocol": "http:",
  6066. "username": "",
  6067. "password": "",
  6068. "host": "example.org",
  6069. "hostname": "example.org",
  6070. "port": "",
  6071. "pathname": "/test",
  6072. "search": "?a",
  6073. "hash": "#bc"
  6074. }
  6075. ]