urltestdata.json 167 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692
  1. [
  2. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js",
  3. "# AS OF https://github.com/web-platform-tests/wpt/commit/2a64dae4641fbd61bd4257df460e188f425b492e",
  4. {
  5. "input": "http://example\t.\norg",
  6. "base": "http://example.org/foo/bar",
  7. "href": "http://example.org/",
  8. "origin": "http://example.org",
  9. "protocol": "http:",
  10. "username": "",
  11. "password": "",
  12. "host": "example.org",
  13. "hostname": "example.org",
  14. "port": "",
  15. "pathname": "/",
  16. "search": "",
  17. "hash": ""
  18. },
  19. {
  20. "input": "http://user:pass@foo:21/bar;par?b#c",
  21. "base": "http://example.org/foo/bar",
  22. "href": "http://user:pass@foo:21/bar;par?b#c",
  23. "origin": "http://foo:21",
  24. "protocol": "http:",
  25. "username": "user",
  26. "password": "pass",
  27. "host": "foo:21",
  28. "hostname": "foo",
  29. "port": "21",
  30. "pathname": "/bar;par",
  31. "search": "?b",
  32. "hash": "#c"
  33. },
  34. {
  35. "input": "https://test:@test",
  36. "base": "about:blank",
  37. "href": "https://test@test/",
  38. "origin": "https://test",
  39. "protocol": "https:",
  40. "username": "test",
  41. "password": "",
  42. "host": "test",
  43. "hostname": "test",
  44. "port": "",
  45. "pathname": "/",
  46. "search": "",
  47. "hash": ""
  48. },
  49. {
  50. "input": "https://:@test",
  51. "base": "about:blank",
  52. "href": "https://test/",
  53. "origin": "https://test",
  54. "protocol": "https:",
  55. "username": "",
  56. "password": "",
  57. "host": "test",
  58. "hostname": "test",
  59. "port": "",
  60. "pathname": "/",
  61. "search": "",
  62. "hash": ""
  63. },
  64. {
  65. "input": "non-special://test:@test/x",
  66. "base": "about:blank",
  67. "href": "non-special://test@test/x",
  68. "origin": "null",
  69. "protocol": "non-special:",
  70. "username": "test",
  71. "password": "",
  72. "host": "test",
  73. "hostname": "test",
  74. "port": "",
  75. "pathname": "/x",
  76. "search": "",
  77. "hash": ""
  78. },
  79. {
  80. "input": "non-special://:@test/x",
  81. "base": "about:blank",
  82. "href": "non-special://test/x",
  83. "origin": "null",
  84. "protocol": "non-special:",
  85. "username": "",
  86. "password": "",
  87. "host": "test",
  88. "hostname": "test",
  89. "port": "",
  90. "pathname": "/x",
  91. "search": "",
  92. "hash": ""
  93. },
  94. {
  95. "input": "http:foo.com",
  96. "base": "http://example.org/foo/bar",
  97. "href": "http://example.org/foo/foo.com",
  98. "origin": "http://example.org",
  99. "protocol": "http:",
  100. "username": "",
  101. "password": "",
  102. "host": "example.org",
  103. "hostname": "example.org",
  104. "port": "",
  105. "pathname": "/foo/foo.com",
  106. "search": "",
  107. "hash": ""
  108. },
  109. {
  110. "input": "\t :foo.com \n",
  111. "base": "http://example.org/foo/bar",
  112. "href": "http://example.org/foo/:foo.com",
  113. "origin": "http://example.org",
  114. "protocol": "http:",
  115. "username": "",
  116. "password": "",
  117. "host": "example.org",
  118. "hostname": "example.org",
  119. "port": "",
  120. "pathname": "/foo/:foo.com",
  121. "search": "",
  122. "hash": ""
  123. },
  124. {
  125. "input": " foo.com ",
  126. "base": "http://example.org/foo/bar",
  127. "href": "http://example.org/foo/foo.com",
  128. "origin": "http://example.org",
  129. "protocol": "http:",
  130. "username": "",
  131. "password": "",
  132. "host": "example.org",
  133. "hostname": "example.org",
  134. "port": "",
  135. "pathname": "/foo/foo.com",
  136. "search": "",
  137. "hash": ""
  138. },
  139. {
  140. "input": "a:\t foo.com",
  141. "base": "http://example.org/foo/bar",
  142. "href": "a: foo.com",
  143. "origin": "null",
  144. "protocol": "a:",
  145. "username": "",
  146. "password": "",
  147. "host": "",
  148. "hostname": "",
  149. "port": "",
  150. "pathname": " foo.com",
  151. "search": "",
  152. "hash": ""
  153. },
  154. {
  155. "input": "http://f:21/ b ? d # e ",
  156. "base": "http://example.org/foo/bar",
  157. "href": "http://f:21/%20b%20?%20d%20#%20e",
  158. "origin": "http://f:21",
  159. "protocol": "http:",
  160. "username": "",
  161. "password": "",
  162. "host": "f:21",
  163. "hostname": "f",
  164. "port": "21",
  165. "pathname": "/%20b%20",
  166. "search": "?%20d%20",
  167. "hash": "#%20e"
  168. },
  169. {
  170. "input": "lolscheme:x x#x x",
  171. "base": "about:blank",
  172. "href": "lolscheme:x x#x%20x",
  173. "protocol": "lolscheme:",
  174. "username": "",
  175. "password": "",
  176. "host": "",
  177. "hostname": "",
  178. "port": "",
  179. "pathname": "x x",
  180. "search": "",
  181. "hash": "#x%20x"
  182. },
  183. {
  184. "input": "http://f:/c",
  185. "base": "http://example.org/foo/bar",
  186. "href": "http://f/c",
  187. "origin": "http://f",
  188. "protocol": "http:",
  189. "username": "",
  190. "password": "",
  191. "host": "f",
  192. "hostname": "f",
  193. "port": "",
  194. "pathname": "/c",
  195. "search": "",
  196. "hash": ""
  197. },
  198. {
  199. "input": "http://f:0/c",
  200. "base": "http://example.org/foo/bar",
  201. "href": "http://f:0/c",
  202. "origin": "http://f:0",
  203. "protocol": "http:",
  204. "username": "",
  205. "password": "",
  206. "host": "f:0",
  207. "hostname": "f",
  208. "port": "0",
  209. "pathname": "/c",
  210. "search": "",
  211. "hash": ""
  212. },
  213. {
  214. "input": "http://f:00000000000000/c",
  215. "base": "http://example.org/foo/bar",
  216. "href": "http://f:0/c",
  217. "origin": "http://f:0",
  218. "protocol": "http:",
  219. "username": "",
  220. "password": "",
  221. "host": "f:0",
  222. "hostname": "f",
  223. "port": "0",
  224. "pathname": "/c",
  225. "search": "",
  226. "hash": ""
  227. },
  228. {
  229. "input": "http://f:00000000000000000000080/c",
  230. "base": "http://example.org/foo/bar",
  231. "href": "http://f/c",
  232. "origin": "http://f",
  233. "protocol": "http:",
  234. "username": "",
  235. "password": "",
  236. "host": "f",
  237. "hostname": "f",
  238. "port": "",
  239. "pathname": "/c",
  240. "search": "",
  241. "hash": ""
  242. },
  243. {
  244. "input": "http://f:b/c",
  245. "base": "http://example.org/foo/bar",
  246. "failure": true
  247. },
  248. {
  249. "input": "http://f: /c",
  250. "base": "http://example.org/foo/bar",
  251. "failure": true
  252. },
  253. {
  254. "input": "http://f:\n/c",
  255. "base": "http://example.org/foo/bar",
  256. "href": "http://f/c",
  257. "origin": "http://f",
  258. "protocol": "http:",
  259. "username": "",
  260. "password": "",
  261. "host": "f",
  262. "hostname": "f",
  263. "port": "",
  264. "pathname": "/c",
  265. "search": "",
  266. "hash": ""
  267. },
  268. {
  269. "input": "http://f:fifty-two/c",
  270. "base": "http://example.org/foo/bar",
  271. "failure": true
  272. },
  273. {
  274. "input": "http://f:999999/c",
  275. "base": "http://example.org/foo/bar",
  276. "failure": true
  277. },
  278. {
  279. "input": "non-special://f:999999/c",
  280. "base": "http://example.org/foo/bar",
  281. "failure": true
  282. },
  283. {
  284. "input": "http://f: 21 / b ? d # e ",
  285. "base": "http://example.org/foo/bar",
  286. "failure": true
  287. },
  288. {
  289. "input": "",
  290. "base": "http://example.org/foo/bar",
  291. "href": "http://example.org/foo/bar",
  292. "origin": "http://example.org",
  293. "protocol": "http:",
  294. "username": "",
  295. "password": "",
  296. "host": "example.org",
  297. "hostname": "example.org",
  298. "port": "",
  299. "pathname": "/foo/bar",
  300. "search": "",
  301. "hash": ""
  302. },
  303. {
  304. "input": " \t",
  305. "base": "http://example.org/foo/bar",
  306. "href": "http://example.org/foo/bar",
  307. "origin": "http://example.org",
  308. "protocol": "http:",
  309. "username": "",
  310. "password": "",
  311. "host": "example.org",
  312. "hostname": "example.org",
  313. "port": "",
  314. "pathname": "/foo/bar",
  315. "search": "",
  316. "hash": ""
  317. },
  318. {
  319. "input": ":foo.com/",
  320. "base": "http://example.org/foo/bar",
  321. "href": "http://example.org/foo/:foo.com/",
  322. "origin": "http://example.org",
  323. "protocol": "http:",
  324. "username": "",
  325. "password": "",
  326. "host": "example.org",
  327. "hostname": "example.org",
  328. "port": "",
  329. "pathname": "/foo/:foo.com/",
  330. "search": "",
  331. "hash": ""
  332. },
  333. {
  334. "input": ":foo.com\\",
  335. "base": "http://example.org/foo/bar",
  336. "href": "http://example.org/foo/:foo.com/",
  337. "origin": "http://example.org",
  338. "protocol": "http:",
  339. "username": "",
  340. "password": "",
  341. "host": "example.org",
  342. "hostname": "example.org",
  343. "port": "",
  344. "pathname": "/foo/:foo.com/",
  345. "search": "",
  346. "hash": ""
  347. },
  348. {
  349. "input": ":",
  350. "base": "http://example.org/foo/bar",
  351. "href": "http://example.org/foo/:",
  352. "origin": "http://example.org",
  353. "protocol": "http:",
  354. "username": "",
  355. "password": "",
  356. "host": "example.org",
  357. "hostname": "example.org",
  358. "port": "",
  359. "pathname": "/foo/:",
  360. "search": "",
  361. "hash": ""
  362. },
  363. {
  364. "input": ":a",
  365. "base": "http://example.org/foo/bar",
  366. "href": "http://example.org/foo/:a",
  367. "origin": "http://example.org",
  368. "protocol": "http:",
  369. "username": "",
  370. "password": "",
  371. "host": "example.org",
  372. "hostname": "example.org",
  373. "port": "",
  374. "pathname": "/foo/:a",
  375. "search": "",
  376. "hash": ""
  377. },
  378. {
  379. "input": ":/",
  380. "base": "http://example.org/foo/bar",
  381. "href": "http://example.org/foo/:/",
  382. "origin": "http://example.org",
  383. "protocol": "http:",
  384. "username": "",
  385. "password": "",
  386. "host": "example.org",
  387. "hostname": "example.org",
  388. "port": "",
  389. "pathname": "/foo/:/",
  390. "search": "",
  391. "hash": ""
  392. },
  393. {
  394. "input": ":\\",
  395. "base": "http://example.org/foo/bar",
  396. "href": "http://example.org/foo/:/",
  397. "origin": "http://example.org",
  398. "protocol": "http:",
  399. "username": "",
  400. "password": "",
  401. "host": "example.org",
  402. "hostname": "example.org",
  403. "port": "",
  404. "pathname": "/foo/:/",
  405. "search": "",
  406. "hash": ""
  407. },
  408. {
  409. "input": ":#",
  410. "base": "http://example.org/foo/bar",
  411. "href": "http://example.org/foo/:#",
  412. "origin": "http://example.org",
  413. "protocol": "http:",
  414. "username": "",
  415. "password": "",
  416. "host": "example.org",
  417. "hostname": "example.org",
  418. "port": "",
  419. "pathname": "/foo/:",
  420. "search": "",
  421. "hash": ""
  422. },
  423. {
  424. "input": "#",
  425. "base": "http://example.org/foo/bar",
  426. "href": "http://example.org/foo/bar#",
  427. "origin": "http://example.org",
  428. "protocol": "http:",
  429. "username": "",
  430. "password": "",
  431. "host": "example.org",
  432. "hostname": "example.org",
  433. "port": "",
  434. "pathname": "/foo/bar",
  435. "search": "",
  436. "hash": ""
  437. },
  438. {
  439. "input": "#/",
  440. "base": "http://example.org/foo/bar",
  441. "href": "http://example.org/foo/bar#/",
  442. "origin": "http://example.org",
  443. "protocol": "http:",
  444. "username": "",
  445. "password": "",
  446. "host": "example.org",
  447. "hostname": "example.org",
  448. "port": "",
  449. "pathname": "/foo/bar",
  450. "search": "",
  451. "hash": "#/"
  452. },
  453. {
  454. "input": "#\\",
  455. "base": "http://example.org/foo/bar",
  456. "href": "http://example.org/foo/bar#\\",
  457. "origin": "http://example.org",
  458. "protocol": "http:",
  459. "username": "",
  460. "password": "",
  461. "host": "example.org",
  462. "hostname": "example.org",
  463. "port": "",
  464. "pathname": "/foo/bar",
  465. "search": "",
  466. "hash": "#\\"
  467. },
  468. {
  469. "input": "#;?",
  470. "base": "http://example.org/foo/bar",
  471. "href": "http://example.org/foo/bar#;?",
  472. "origin": "http://example.org",
  473. "protocol": "http:",
  474. "username": "",
  475. "password": "",
  476. "host": "example.org",
  477. "hostname": "example.org",
  478. "port": "",
  479. "pathname": "/foo/bar",
  480. "search": "",
  481. "hash": "#;?"
  482. },
  483. {
  484. "input": "?",
  485. "base": "http://example.org/foo/bar",
  486. "href": "http://example.org/foo/bar?",
  487. "origin": "http://example.org",
  488. "protocol": "http:",
  489. "username": "",
  490. "password": "",
  491. "host": "example.org",
  492. "hostname": "example.org",
  493. "port": "",
  494. "pathname": "/foo/bar",
  495. "search": "",
  496. "hash": ""
  497. },
  498. {
  499. "input": "/",
  500. "base": "http://example.org/foo/bar",
  501. "href": "http://example.org/",
  502. "origin": "http://example.org",
  503. "protocol": "http:",
  504. "username": "",
  505. "password": "",
  506. "host": "example.org",
  507. "hostname": "example.org",
  508. "port": "",
  509. "pathname": "/",
  510. "search": "",
  511. "hash": ""
  512. },
  513. {
  514. "input": ":23",
  515. "base": "http://example.org/foo/bar",
  516. "href": "http://example.org/foo/:23",
  517. "origin": "http://example.org",
  518. "protocol": "http:",
  519. "username": "",
  520. "password": "",
  521. "host": "example.org",
  522. "hostname": "example.org",
  523. "port": "",
  524. "pathname": "/foo/:23",
  525. "search": "",
  526. "hash": ""
  527. },
  528. {
  529. "input": "/:23",
  530. "base": "http://example.org/foo/bar",
  531. "href": "http://example.org/:23",
  532. "origin": "http://example.org",
  533. "protocol": "http:",
  534. "username": "",
  535. "password": "",
  536. "host": "example.org",
  537. "hostname": "example.org",
  538. "port": "",
  539. "pathname": "/:23",
  540. "search": "",
  541. "hash": ""
  542. },
  543. {
  544. "input": "\\x",
  545. "base": "http://example.org/foo/bar",
  546. "href": "http://example.org/x",
  547. "origin": "http://example.org",
  548. "protocol": "http:",
  549. "username": "",
  550. "password": "",
  551. "host": "example.org",
  552. "hostname": "example.org",
  553. "port": "",
  554. "pathname": "/x",
  555. "search": "",
  556. "hash": ""
  557. },
  558. {
  559. "input": "\\\\x\\hello",
  560. "base": "http://example.org/foo/bar",
  561. "href": "http://x/hello",
  562. "origin": "http://x",
  563. "protocol": "http:",
  564. "username": "",
  565. "password": "",
  566. "host": "x",
  567. "hostname": "x",
  568. "port": "",
  569. "pathname": "/hello",
  570. "search": "",
  571. "hash": ""
  572. },
  573. {
  574. "input": "::",
  575. "base": "http://example.org/foo/bar",
  576. "href": "http://example.org/foo/::",
  577. "origin": "http://example.org",
  578. "protocol": "http:",
  579. "username": "",
  580. "password": "",
  581. "host": "example.org",
  582. "hostname": "example.org",
  583. "port": "",
  584. "pathname": "/foo/::",
  585. "search": "",
  586. "hash": ""
  587. },
  588. {
  589. "input": "::23",
  590. "base": "http://example.org/foo/bar",
  591. "href": "http://example.org/foo/::23",
  592. "origin": "http://example.org",
  593. "protocol": "http:",
  594. "username": "",
  595. "password": "",
  596. "host": "example.org",
  597. "hostname": "example.org",
  598. "port": "",
  599. "pathname": "/foo/::23",
  600. "search": "",
  601. "hash": ""
  602. },
  603. {
  604. "input": "foo://",
  605. "base": "http://example.org/foo/bar",
  606. "href": "foo://",
  607. "origin": "null",
  608. "protocol": "foo:",
  609. "username": "",
  610. "password": "",
  611. "host": "",
  612. "hostname": "",
  613. "port": "",
  614. "pathname": "",
  615. "search": "",
  616. "hash": ""
  617. },
  618. {
  619. "input": "http://a:b@c:29/d",
  620. "base": "http://example.org/foo/bar",
  621. "href": "http://a:b@c:29/d",
  622. "origin": "http://c:29",
  623. "protocol": "http:",
  624. "username": "a",
  625. "password": "b",
  626. "host": "c:29",
  627. "hostname": "c",
  628. "port": "29",
  629. "pathname": "/d",
  630. "search": "",
  631. "hash": ""
  632. },
  633. {
  634. "input": "http::@c:29",
  635. "base": "http://example.org/foo/bar",
  636. "href": "http://example.org/foo/:@c:29",
  637. "origin": "http://example.org",
  638. "protocol": "http:",
  639. "username": "",
  640. "password": "",
  641. "host": "example.org",
  642. "hostname": "example.org",
  643. "port": "",
  644. "pathname": "/foo/:@c:29",
  645. "search": "",
  646. "hash": ""
  647. },
  648. {
  649. "input": "http://&a:foo(b]c@d:2/",
  650. "base": "http://example.org/foo/bar",
  651. "href": "http://&a:foo(b%5Dc@d:2/",
  652. "origin": "http://d:2",
  653. "protocol": "http:",
  654. "username": "&a",
  655. "password": "foo(b%5Dc",
  656. "host": "d:2",
  657. "hostname": "d",
  658. "port": "2",
  659. "pathname": "/",
  660. "search": "",
  661. "hash": ""
  662. },
  663. {
  664. "input": "http://::@c@d:2",
  665. "base": "http://example.org/foo/bar",
  666. "href": "http://:%3A%40c@d:2/",
  667. "origin": "http://d:2",
  668. "protocol": "http:",
  669. "username": "",
  670. "password": "%3A%40c",
  671. "host": "d:2",
  672. "hostname": "d",
  673. "port": "2",
  674. "pathname": "/",
  675. "search": "",
  676. "hash": ""
  677. },
  678. {
  679. "input": "http://foo.com:b@d/",
  680. "base": "http://example.org/foo/bar",
  681. "href": "http://foo.com:b@d/",
  682. "origin": "http://d",
  683. "protocol": "http:",
  684. "username": "foo.com",
  685. "password": "b",
  686. "host": "d",
  687. "hostname": "d",
  688. "port": "",
  689. "pathname": "/",
  690. "search": "",
  691. "hash": ""
  692. },
  693. {
  694. "input": "http://foo.com/\\@",
  695. "base": "http://example.org/foo/bar",
  696. "href": "http://foo.com//@",
  697. "origin": "http://foo.com",
  698. "protocol": "http:",
  699. "username": "",
  700. "password": "",
  701. "host": "foo.com",
  702. "hostname": "foo.com",
  703. "port": "",
  704. "pathname": "//@",
  705. "search": "",
  706. "hash": ""
  707. },
  708. {
  709. "input": "http:\\\\foo.com\\",
  710. "base": "http://example.org/foo/bar",
  711. "href": "http://foo.com/",
  712. "origin": "http://foo.com",
  713. "protocol": "http:",
  714. "username": "",
  715. "password": "",
  716. "host": "foo.com",
  717. "hostname": "foo.com",
  718. "port": "",
  719. "pathname": "/",
  720. "search": "",
  721. "hash": ""
  722. },
  723. {
  724. "input": "http:\\\\a\\b:c\\d@foo.com\\",
  725. "base": "http://example.org/foo/bar",
  726. "href": "http://a/b:c/d@foo.com/",
  727. "origin": "http://a",
  728. "protocol": "http:",
  729. "username": "",
  730. "password": "",
  731. "host": "a",
  732. "hostname": "a",
  733. "port": "",
  734. "pathname": "/b:c/d@foo.com/",
  735. "search": "",
  736. "hash": ""
  737. },
  738. {
  739. "input": "foo:/",
  740. "base": "http://example.org/foo/bar",
  741. "href": "foo:/",
  742. "origin": "null",
  743. "protocol": "foo:",
  744. "username": "",
  745. "password": "",
  746. "host": "",
  747. "hostname": "",
  748. "port": "",
  749. "pathname": "/",
  750. "search": "",
  751. "hash": ""
  752. },
  753. {
  754. "input": "foo:/bar.com/",
  755. "base": "http://example.org/foo/bar",
  756. "href": "foo:/bar.com/",
  757. "origin": "null",
  758. "protocol": "foo:",
  759. "username": "",
  760. "password": "",
  761. "host": "",
  762. "hostname": "",
  763. "port": "",
  764. "pathname": "/bar.com/",
  765. "search": "",
  766. "hash": ""
  767. },
  768. {
  769. "input": "foo://///////",
  770. "base": "http://example.org/foo/bar",
  771. "href": "foo://///////",
  772. "origin": "null",
  773. "protocol": "foo:",
  774. "username": "",
  775. "password": "",
  776. "host": "",
  777. "hostname": "",
  778. "port": "",
  779. "pathname": "///////",
  780. "search": "",
  781. "hash": ""
  782. },
  783. {
  784. "input": "foo://///////bar.com/",
  785. "base": "http://example.org/foo/bar",
  786. "href": "foo://///////bar.com/",
  787. "origin": "null",
  788. "protocol": "foo:",
  789. "username": "",
  790. "password": "",
  791. "host": "",
  792. "hostname": "",
  793. "port": "",
  794. "pathname": "///////bar.com/",
  795. "search": "",
  796. "hash": ""
  797. },
  798. {
  799. "input": "foo:////://///",
  800. "base": "http://example.org/foo/bar",
  801. "href": "foo:////://///",
  802. "origin": "null",
  803. "protocol": "foo:",
  804. "username": "",
  805. "password": "",
  806. "host": "",
  807. "hostname": "",
  808. "port": "",
  809. "pathname": "//://///",
  810. "search": "",
  811. "hash": ""
  812. },
  813. {
  814. "input": "c:/foo",
  815. "base": "http://example.org/foo/bar",
  816. "href": "c:/foo",
  817. "origin": "null",
  818. "protocol": "c:",
  819. "username": "",
  820. "password": "",
  821. "host": "",
  822. "hostname": "",
  823. "port": "",
  824. "pathname": "/foo",
  825. "search": "",
  826. "hash": ""
  827. },
  828. {
  829. "input": "//foo/bar",
  830. "base": "http://example.org/foo/bar",
  831. "href": "http://foo/bar",
  832. "origin": "http://foo",
  833. "protocol": "http:",
  834. "username": "",
  835. "password": "",
  836. "host": "foo",
  837. "hostname": "foo",
  838. "port": "",
  839. "pathname": "/bar",
  840. "search": "",
  841. "hash": ""
  842. },
  843. {
  844. "input": "http://foo/path;a??e#f#g",
  845. "base": "http://example.org/foo/bar",
  846. "href": "http://foo/path;a??e#f#g",
  847. "origin": "http://foo",
  848. "protocol": "http:",
  849. "username": "",
  850. "password": "",
  851. "host": "foo",
  852. "hostname": "foo",
  853. "port": "",
  854. "pathname": "/path;a",
  855. "search": "??e",
  856. "hash": "#f#g"
  857. },
  858. {
  859. "input": "http://foo/abcd?efgh?ijkl",
  860. "base": "http://example.org/foo/bar",
  861. "href": "http://foo/abcd?efgh?ijkl",
  862. "origin": "http://foo",
  863. "protocol": "http:",
  864. "username": "",
  865. "password": "",
  866. "host": "foo",
  867. "hostname": "foo",
  868. "port": "",
  869. "pathname": "/abcd",
  870. "search": "?efgh?ijkl",
  871. "hash": ""
  872. },
  873. {
  874. "input": "http://foo/abcd#foo?bar",
  875. "base": "http://example.org/foo/bar",
  876. "href": "http://foo/abcd#foo?bar",
  877. "origin": "http://foo",
  878. "protocol": "http:",
  879. "username": "",
  880. "password": "",
  881. "host": "foo",
  882. "hostname": "foo",
  883. "port": "",
  884. "pathname": "/abcd",
  885. "search": "",
  886. "hash": "#foo?bar"
  887. },
  888. {
  889. "input": "[61:24:74]:98",
  890. "base": "http://example.org/foo/bar",
  891. "href": "http://example.org/foo/[61:24:74]:98",
  892. "origin": "http://example.org",
  893. "protocol": "http:",
  894. "username": "",
  895. "password": "",
  896. "host": "example.org",
  897. "hostname": "example.org",
  898. "port": "",
  899. "pathname": "/foo/[61:24:74]:98",
  900. "search": "",
  901. "hash": ""
  902. },
  903. {
  904. "input": "http:[61:27]/:foo",
  905. "base": "http://example.org/foo/bar",
  906. "href": "http://example.org/foo/[61:27]/:foo",
  907. "origin": "http://example.org",
  908. "protocol": "http:",
  909. "username": "",
  910. "password": "",
  911. "host": "example.org",
  912. "hostname": "example.org",
  913. "port": "",
  914. "pathname": "/foo/[61:27]/:foo",
  915. "search": "",
  916. "hash": ""
  917. },
  918. {
  919. "input": "http://[1::2]:3:4",
  920. "base": "http://example.org/foo/bar",
  921. "failure": true
  922. },
  923. {
  924. "input": "http://2001::1",
  925. "base": "http://example.org/foo/bar",
  926. "failure": true
  927. },
  928. {
  929. "input": "http://2001::1]",
  930. "base": "http://example.org/foo/bar",
  931. "failure": true
  932. },
  933. {
  934. "input": "http://2001::1]:80",
  935. "base": "http://example.org/foo/bar",
  936. "failure": true
  937. },
  938. {
  939. "input": "http://[2001::1]",
  940. "base": "http://example.org/foo/bar",
  941. "href": "http://[2001::1]/",
  942. "origin": "http://[2001::1]",
  943. "protocol": "http:",
  944. "username": "",
  945. "password": "",
  946. "host": "[2001::1]",
  947. "hostname": "[2001::1]",
  948. "port": "",
  949. "pathname": "/",
  950. "search": "",
  951. "hash": ""
  952. },
  953. {
  954. "input": "http://[::127.0.0.1]",
  955. "base": "http://example.org/foo/bar",
  956. "href": "http://[::7f00:1]/",
  957. "origin": "http://[::7f00:1]",
  958. "protocol": "http:",
  959. "username": "",
  960. "password": "",
  961. "host": "[::7f00:1]",
  962. "hostname": "[::7f00:1]",
  963. "port": "",
  964. "pathname": "/",
  965. "search": "",
  966. "hash": ""
  967. },
  968. {
  969. "input": "http://[0:0:0:0:0:0:13.1.68.3]",
  970. "base": "http://example.org/foo/bar",
  971. "href": "http://[::d01:4403]/",
  972. "origin": "http://[::d01:4403]",
  973. "protocol": "http:",
  974. "username": "",
  975. "password": "",
  976. "host": "[::d01:4403]",
  977. "hostname": "[::d01:4403]",
  978. "port": "",
  979. "pathname": "/",
  980. "search": "",
  981. "hash": ""
  982. },
  983. {
  984. "input": "http://[2001::1]:80",
  985. "base": "http://example.org/foo/bar",
  986. "href": "http://[2001::1]/",
  987. "origin": "http://[2001::1]",
  988. "protocol": "http:",
  989. "username": "",
  990. "password": "",
  991. "host": "[2001::1]",
  992. "hostname": "[2001::1]",
  993. "port": "",
  994. "pathname": "/",
  995. "search": "",
  996. "hash": ""
  997. },
  998. {
  999. "input": "http:/example.com/",
  1000. "base": "http://example.org/foo/bar",
  1001. "href": "http://example.org/example.com/",
  1002. "origin": "http://example.org",
  1003. "protocol": "http:",
  1004. "username": "",
  1005. "password": "",
  1006. "host": "example.org",
  1007. "hostname": "example.org",
  1008. "port": "",
  1009. "pathname": "/example.com/",
  1010. "search": "",
  1011. "hash": ""
  1012. },
  1013. {
  1014. "input": "ftp:/example.com/",
  1015. "base": "http://example.org/foo/bar",
  1016. "href": "ftp://example.com/",
  1017. "origin": "ftp://example.com",
  1018. "protocol": "ftp:",
  1019. "username": "",
  1020. "password": "",
  1021. "host": "example.com",
  1022. "hostname": "example.com",
  1023. "port": "",
  1024. "pathname": "/",
  1025. "search": "",
  1026. "hash": ""
  1027. },
  1028. {
  1029. "input": "https:/example.com/",
  1030. "base": "http://example.org/foo/bar",
  1031. "href": "https://example.com/",
  1032. "origin": "https://example.com",
  1033. "protocol": "https:",
  1034. "username": "",
  1035. "password": "",
  1036. "host": "example.com",
  1037. "hostname": "example.com",
  1038. "port": "",
  1039. "pathname": "/",
  1040. "search": "",
  1041. "hash": ""
  1042. },
  1043. {
  1044. "input": "madeupscheme:/example.com/",
  1045. "base": "http://example.org/foo/bar",
  1046. "href": "madeupscheme:/example.com/",
  1047. "origin": "null",
  1048. "protocol": "madeupscheme:",
  1049. "username": "",
  1050. "password": "",
  1051. "host": "",
  1052. "hostname": "",
  1053. "port": "",
  1054. "pathname": "/example.com/",
  1055. "search": "",
  1056. "hash": ""
  1057. },
  1058. {
  1059. "input": "file:/example.com/",
  1060. "base": "http://example.org/foo/bar",
  1061. "href": "file:///example.com/",
  1062. "protocol": "file:",
  1063. "username": "",
  1064. "password": "",
  1065. "host": "",
  1066. "hostname": "",
  1067. "port": "",
  1068. "pathname": "/example.com/",
  1069. "search": "",
  1070. "hash": ""
  1071. },
  1072. {
  1073. "input": "file://example:1/",
  1074. "base": "about:blank",
  1075. "failure": true
  1076. },
  1077. {
  1078. "input": "file://example:test/",
  1079. "base": "about:blank",
  1080. "failure": true
  1081. },
  1082. {
  1083. "input": "file://example%/",
  1084. "base": "about:blank",
  1085. "failure": true
  1086. },
  1087. {
  1088. "input": "file://[example]/",
  1089. "base": "about:blank",
  1090. "failure": true
  1091. },
  1092. {
  1093. "input": "ftps:/example.com/",
  1094. "base": "http://example.org/foo/bar",
  1095. "href": "ftps:/example.com/",
  1096. "origin": "null",
  1097. "protocol": "ftps:",
  1098. "username": "",
  1099. "password": "",
  1100. "host": "",
  1101. "hostname": "",
  1102. "port": "",
  1103. "pathname": "/example.com/",
  1104. "search": "",
  1105. "hash": ""
  1106. },
  1107. {
  1108. "input": "gopher:/example.com/",
  1109. "base": "http://example.org/foo/bar",
  1110. "href": "gopher:/example.com/",
  1111. "origin": "null",
  1112. "protocol": "gopher:",
  1113. "username": "",
  1114. "password": "",
  1115. "host": "",
  1116. "hostname": "",
  1117. "port": "",
  1118. "pathname": "/example.com/",
  1119. "search": "",
  1120. "hash": ""
  1121. },
  1122. {
  1123. "input": "ws:/example.com/",
  1124. "base": "http://example.org/foo/bar",
  1125. "href": "ws://example.com/",
  1126. "origin": "ws://example.com",
  1127. "protocol": "ws:",
  1128. "username": "",
  1129. "password": "",
  1130. "host": "example.com",
  1131. "hostname": "example.com",
  1132. "port": "",
  1133. "pathname": "/",
  1134. "search": "",
  1135. "hash": ""
  1136. },
  1137. {
  1138. "input": "wss:/example.com/",
  1139. "base": "http://example.org/foo/bar",
  1140. "href": "wss://example.com/",
  1141. "origin": "wss://example.com",
  1142. "protocol": "wss:",
  1143. "username": "",
  1144. "password": "",
  1145. "host": "example.com",
  1146. "hostname": "example.com",
  1147. "port": "",
  1148. "pathname": "/",
  1149. "search": "",
  1150. "hash": ""
  1151. },
  1152. {
  1153. "input": "data:/example.com/",
  1154. "base": "http://example.org/foo/bar",
  1155. "href": "data:/example.com/",
  1156. "origin": "null",
  1157. "protocol": "data:",
  1158. "username": "",
  1159. "password": "",
  1160. "host": "",
  1161. "hostname": "",
  1162. "port": "",
  1163. "pathname": "/example.com/",
  1164. "search": "",
  1165. "hash": ""
  1166. },
  1167. {
  1168. "input": "javascript:/example.com/",
  1169. "base": "http://example.org/foo/bar",
  1170. "href": "javascript:/example.com/",
  1171. "origin": "null",
  1172. "protocol": "javascript:",
  1173. "username": "",
  1174. "password": "",
  1175. "host": "",
  1176. "hostname": "",
  1177. "port": "",
  1178. "pathname": "/example.com/",
  1179. "search": "",
  1180. "hash": ""
  1181. },
  1182. {
  1183. "input": "mailto:/example.com/",
  1184. "base": "http://example.org/foo/bar",
  1185. "href": "mailto:/example.com/",
  1186. "origin": "null",
  1187. "protocol": "mailto:",
  1188. "username": "",
  1189. "password": "",
  1190. "host": "",
  1191. "hostname": "",
  1192. "port": "",
  1193. "pathname": "/example.com/",
  1194. "search": "",
  1195. "hash": ""
  1196. },
  1197. {
  1198. "input": "http:example.com/",
  1199. "base": "http://example.org/foo/bar",
  1200. "href": "http://example.org/foo/example.com/",
  1201. "origin": "http://example.org",
  1202. "protocol": "http:",
  1203. "username": "",
  1204. "password": "",
  1205. "host": "example.org",
  1206. "hostname": "example.org",
  1207. "port": "",
  1208. "pathname": "/foo/example.com/",
  1209. "search": "",
  1210. "hash": ""
  1211. },
  1212. {
  1213. "input": "ftp:example.com/",
  1214. "base": "http://example.org/foo/bar",
  1215. "href": "ftp://example.com/",
  1216. "origin": "ftp://example.com",
  1217. "protocol": "ftp:",
  1218. "username": "",
  1219. "password": "",
  1220. "host": "example.com",
  1221. "hostname": "example.com",
  1222. "port": "",
  1223. "pathname": "/",
  1224. "search": "",
  1225. "hash": ""
  1226. },
  1227. {
  1228. "input": "https:example.com/",
  1229. "base": "http://example.org/foo/bar",
  1230. "href": "https://example.com/",
  1231. "origin": "https://example.com",
  1232. "protocol": "https:",
  1233. "username": "",
  1234. "password": "",
  1235. "host": "example.com",
  1236. "hostname": "example.com",
  1237. "port": "",
  1238. "pathname": "/",
  1239. "search": "",
  1240. "hash": ""
  1241. },
  1242. {
  1243. "input": "madeupscheme:example.com/",
  1244. "base": "http://example.org/foo/bar",
  1245. "href": "madeupscheme:example.com/",
  1246. "origin": "null",
  1247. "protocol": "madeupscheme:",
  1248. "username": "",
  1249. "password": "",
  1250. "host": "",
  1251. "hostname": "",
  1252. "port": "",
  1253. "pathname": "example.com/",
  1254. "search": "",
  1255. "hash": ""
  1256. },
  1257. {
  1258. "input": "ftps:example.com/",
  1259. "base": "http://example.org/foo/bar",
  1260. "href": "ftps:example.com/",
  1261. "origin": "null",
  1262. "protocol": "ftps:",
  1263. "username": "",
  1264. "password": "",
  1265. "host": "",
  1266. "hostname": "",
  1267. "port": "",
  1268. "pathname": "example.com/",
  1269. "search": "",
  1270. "hash": ""
  1271. },
  1272. {
  1273. "input": "gopher:example.com/",
  1274. "base": "http://example.org/foo/bar",
  1275. "href": "gopher:example.com/",
  1276. "origin": "null",
  1277. "protocol": "gopher:",
  1278. "username": "",
  1279. "password": "",
  1280. "host": "",
  1281. "hostname": "",
  1282. "port": "",
  1283. "pathname": "example.com/",
  1284. "search": "",
  1285. "hash": ""
  1286. },
  1287. {
  1288. "input": "ws:example.com/",
  1289. "base": "http://example.org/foo/bar",
  1290. "href": "ws://example.com/",
  1291. "origin": "ws://example.com",
  1292. "protocol": "ws:",
  1293. "username": "",
  1294. "password": "",
  1295. "host": "example.com",
  1296. "hostname": "example.com",
  1297. "port": "",
  1298. "pathname": "/",
  1299. "search": "",
  1300. "hash": ""
  1301. },
  1302. {
  1303. "input": "wss:example.com/",
  1304. "base": "http://example.org/foo/bar",
  1305. "href": "wss://example.com/",
  1306. "origin": "wss://example.com",
  1307. "protocol": "wss:",
  1308. "username": "",
  1309. "password": "",
  1310. "host": "example.com",
  1311. "hostname": "example.com",
  1312. "port": "",
  1313. "pathname": "/",
  1314. "search": "",
  1315. "hash": ""
  1316. },
  1317. {
  1318. "input": "data:example.com/",
  1319. "base": "http://example.org/foo/bar",
  1320. "href": "data:example.com/",
  1321. "origin": "null",
  1322. "protocol": "data:",
  1323. "username": "",
  1324. "password": "",
  1325. "host": "",
  1326. "hostname": "",
  1327. "port": "",
  1328. "pathname": "example.com/",
  1329. "search": "",
  1330. "hash": ""
  1331. },
  1332. {
  1333. "input": "javascript:example.com/",
  1334. "base": "http://example.org/foo/bar",
  1335. "href": "javascript:example.com/",
  1336. "origin": "null",
  1337. "protocol": "javascript:",
  1338. "username": "",
  1339. "password": "",
  1340. "host": "",
  1341. "hostname": "",
  1342. "port": "",
  1343. "pathname": "example.com/",
  1344. "search": "",
  1345. "hash": ""
  1346. },
  1347. {
  1348. "input": "mailto:example.com/",
  1349. "base": "http://example.org/foo/bar",
  1350. "href": "mailto:example.com/",
  1351. "origin": "null",
  1352. "protocol": "mailto:",
  1353. "username": "",
  1354. "password": "",
  1355. "host": "",
  1356. "hostname": "",
  1357. "port": "",
  1358. "pathname": "example.com/",
  1359. "search": "",
  1360. "hash": ""
  1361. },
  1362. {
  1363. "input": "/a/b/c",
  1364. "base": "http://example.org/foo/bar",
  1365. "href": "http://example.org/a/b/c",
  1366. "origin": "http://example.org",
  1367. "protocol": "http:",
  1368. "username": "",
  1369. "password": "",
  1370. "host": "example.org",
  1371. "hostname": "example.org",
  1372. "port": "",
  1373. "pathname": "/a/b/c",
  1374. "search": "",
  1375. "hash": ""
  1376. },
  1377. {
  1378. "input": "/a/ /c",
  1379. "base": "http://example.org/foo/bar",
  1380. "href": "http://example.org/a/%20/c",
  1381. "origin": "http://example.org",
  1382. "protocol": "http:",
  1383. "username": "",
  1384. "password": "",
  1385. "host": "example.org",
  1386. "hostname": "example.org",
  1387. "port": "",
  1388. "pathname": "/a/%20/c",
  1389. "search": "",
  1390. "hash": ""
  1391. },
  1392. {
  1393. "input": "/a%2fc",
  1394. "base": "http://example.org/foo/bar",
  1395. "href": "http://example.org/a%2fc",
  1396. "origin": "http://example.org",
  1397. "protocol": "http:",
  1398. "username": "",
  1399. "password": "",
  1400. "host": "example.org",
  1401. "hostname": "example.org",
  1402. "port": "",
  1403. "pathname": "/a%2fc",
  1404. "search": "",
  1405. "hash": ""
  1406. },
  1407. {
  1408. "input": "/a/%2f/c",
  1409. "base": "http://example.org/foo/bar",
  1410. "href": "http://example.org/a/%2f/c",
  1411. "origin": "http://example.org",
  1412. "protocol": "http:",
  1413. "username": "",
  1414. "password": "",
  1415. "host": "example.org",
  1416. "hostname": "example.org",
  1417. "port": "",
  1418. "pathname": "/a/%2f/c",
  1419. "search": "",
  1420. "hash": ""
  1421. },
  1422. {
  1423. "input": "#β",
  1424. "base": "http://example.org/foo/bar",
  1425. "href": "http://example.org/foo/bar#%CE%B2",
  1426. "origin": "http://example.org",
  1427. "protocol": "http:",
  1428. "username": "",
  1429. "password": "",
  1430. "host": "example.org",
  1431. "hostname": "example.org",
  1432. "port": "",
  1433. "pathname": "/foo/bar",
  1434. "search": "",
  1435. "hash": "#%CE%B2"
  1436. },
  1437. {
  1438. "input": "data:text/html,test#test",
  1439. "base": "http://example.org/foo/bar",
  1440. "href": "data:text/html,test#test",
  1441. "origin": "null",
  1442. "protocol": "data:",
  1443. "username": "",
  1444. "password": "",
  1445. "host": "",
  1446. "hostname": "",
  1447. "port": "",
  1448. "pathname": "text/html,test",
  1449. "search": "",
  1450. "hash": "#test"
  1451. },
  1452. {
  1453. "input": "tel:1234567890",
  1454. "base": "http://example.org/foo/bar",
  1455. "href": "tel:1234567890",
  1456. "origin": "null",
  1457. "protocol": "tel:",
  1458. "username": "",
  1459. "password": "",
  1460. "host": "",
  1461. "hostname": "",
  1462. "port": "",
  1463. "pathname": "1234567890",
  1464. "search": "",
  1465. "hash": ""
  1466. },
  1467. "# Based on https://felixfbecker.github.io/whatwg-url-custom-host-repro/",
  1468. {
  1469. "input": "ssh://example.com/foo/bar.git",
  1470. "base": "http://example.org/",
  1471. "href": "ssh://example.com/foo/bar.git",
  1472. "origin": "null",
  1473. "protocol": "ssh:",
  1474. "username": "",
  1475. "password": "",
  1476. "host": "example.com",
  1477. "hostname": "example.com",
  1478. "port": "",
  1479. "pathname": "/foo/bar.git",
  1480. "search": "",
  1481. "hash": ""
  1482. },
  1483. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
  1484. {
  1485. "input": "file:c:\\foo\\bar.html",
  1486. "base": "file:///tmp/mock/path",
  1487. "href": "file:///c:/foo/bar.html",
  1488. "protocol": "file:",
  1489. "username": "",
  1490. "password": "",
  1491. "host": "",
  1492. "hostname": "",
  1493. "port": "",
  1494. "pathname": "/c:/foo/bar.html",
  1495. "search": "",
  1496. "hash": ""
  1497. },
  1498. {
  1499. "input": " File:c|////foo\\bar.html",
  1500. "base": "file:///tmp/mock/path",
  1501. "href": "file:///c:////foo/bar.html",
  1502. "protocol": "file:",
  1503. "username": "",
  1504. "password": "",
  1505. "host": "",
  1506. "hostname": "",
  1507. "port": "",
  1508. "pathname": "/c:////foo/bar.html",
  1509. "search": "",
  1510. "hash": ""
  1511. },
  1512. {
  1513. "input": "C|/foo/bar",
  1514. "base": "file:///tmp/mock/path",
  1515. "href": "file:///C:/foo/bar",
  1516. "protocol": "file:",
  1517. "username": "",
  1518. "password": "",
  1519. "host": "",
  1520. "hostname": "",
  1521. "port": "",
  1522. "pathname": "/C:/foo/bar",
  1523. "search": "",
  1524. "hash": ""
  1525. },
  1526. {
  1527. "input": "/C|\\foo\\bar",
  1528. "base": "file:///tmp/mock/path",
  1529. "href": "file:///C:/foo/bar",
  1530. "protocol": "file:",
  1531. "username": "",
  1532. "password": "",
  1533. "host": "",
  1534. "hostname": "",
  1535. "port": "",
  1536. "pathname": "/C:/foo/bar",
  1537. "search": "",
  1538. "hash": ""
  1539. },
  1540. {
  1541. "input": "//C|/foo/bar",
  1542. "base": "file:///tmp/mock/path",
  1543. "href": "file:///C:/foo/bar",
  1544. "protocol": "file:",
  1545. "username": "",
  1546. "password": "",
  1547. "host": "",
  1548. "hostname": "",
  1549. "port": "",
  1550. "pathname": "/C:/foo/bar",
  1551. "search": "",
  1552. "hash": ""
  1553. },
  1554. {
  1555. "input": "//server/file",
  1556. "base": "file:///tmp/mock/path",
  1557. "href": "file://server/file",
  1558. "protocol": "file:",
  1559. "username": "",
  1560. "password": "",
  1561. "host": "server",
  1562. "hostname": "server",
  1563. "port": "",
  1564. "pathname": "/file",
  1565. "search": "",
  1566. "hash": ""
  1567. },
  1568. {
  1569. "input": "\\\\server\\file",
  1570. "base": "file:///tmp/mock/path",
  1571. "href": "file://server/file",
  1572. "protocol": "file:",
  1573. "username": "",
  1574. "password": "",
  1575. "host": "server",
  1576. "hostname": "server",
  1577. "port": "",
  1578. "pathname": "/file",
  1579. "search": "",
  1580. "hash": ""
  1581. },
  1582. {
  1583. "input": "/\\server/file",
  1584. "base": "file:///tmp/mock/path",
  1585. "href": "file://server/file",
  1586. "protocol": "file:",
  1587. "username": "",
  1588. "password": "",
  1589. "host": "server",
  1590. "hostname": "server",
  1591. "port": "",
  1592. "pathname": "/file",
  1593. "search": "",
  1594. "hash": ""
  1595. },
  1596. {
  1597. "input": "file:///foo/bar.txt",
  1598. "base": "file:///tmp/mock/path",
  1599. "href": "file:///foo/bar.txt",
  1600. "protocol": "file:",
  1601. "username": "",
  1602. "password": "",
  1603. "host": "",
  1604. "hostname": "",
  1605. "port": "",
  1606. "pathname": "/foo/bar.txt",
  1607. "search": "",
  1608. "hash": ""
  1609. },
  1610. {
  1611. "input": "file:///home/me",
  1612. "base": "file:///tmp/mock/path",
  1613. "href": "file:///home/me",
  1614. "protocol": "file:",
  1615. "username": "",
  1616. "password": "",
  1617. "host": "",
  1618. "hostname": "",
  1619. "port": "",
  1620. "pathname": "/home/me",
  1621. "search": "",
  1622. "hash": ""
  1623. },
  1624. {
  1625. "input": "//",
  1626. "base": "file:///tmp/mock/path",
  1627. "href": "file:///",
  1628. "protocol": "file:",
  1629. "username": "",
  1630. "password": "",
  1631. "host": "",
  1632. "hostname": "",
  1633. "port": "",
  1634. "pathname": "/",
  1635. "search": "",
  1636. "hash": ""
  1637. },
  1638. {
  1639. "input": "///",
  1640. "base": "file:///tmp/mock/path",
  1641. "href": "file:///",
  1642. "protocol": "file:",
  1643. "username": "",
  1644. "password": "",
  1645. "host": "",
  1646. "hostname": "",
  1647. "port": "",
  1648. "pathname": "/",
  1649. "search": "",
  1650. "hash": ""
  1651. },
  1652. {
  1653. "input": "///test",
  1654. "base": "file:///tmp/mock/path",
  1655. "href": "file:///test",
  1656. "protocol": "file:",
  1657. "username": "",
  1658. "password": "",
  1659. "host": "",
  1660. "hostname": "",
  1661. "port": "",
  1662. "pathname": "/test",
  1663. "search": "",
  1664. "hash": ""
  1665. },
  1666. {
  1667. "input": "file://test",
  1668. "base": "file:///tmp/mock/path",
  1669. "href": "file://test/",
  1670. "protocol": "file:",
  1671. "username": "",
  1672. "password": "",
  1673. "host": "test",
  1674. "hostname": "test",
  1675. "port": "",
  1676. "pathname": "/",
  1677. "search": "",
  1678. "hash": ""
  1679. },
  1680. {
  1681. "input": "file://localhost",
  1682. "base": "file:///tmp/mock/path",
  1683. "href": "file:///",
  1684. "protocol": "file:",
  1685. "username": "",
  1686. "password": "",
  1687. "host": "",
  1688. "hostname": "",
  1689. "port": "",
  1690. "pathname": "/",
  1691. "search": "",
  1692. "hash": ""
  1693. },
  1694. {
  1695. "input": "file://localhost/",
  1696. "base": "file:///tmp/mock/path",
  1697. "href": "file:///",
  1698. "protocol": "file:",
  1699. "username": "",
  1700. "password": "",
  1701. "host": "",
  1702. "hostname": "",
  1703. "port": "",
  1704. "pathname": "/",
  1705. "search": "",
  1706. "hash": ""
  1707. },
  1708. {
  1709. "input": "file://localhost/test",
  1710. "base": "file:///tmp/mock/path",
  1711. "href": "file:///test",
  1712. "protocol": "file:",
  1713. "username": "",
  1714. "password": "",
  1715. "host": "",
  1716. "hostname": "",
  1717. "port": "",
  1718. "pathname": "/test",
  1719. "search": "",
  1720. "hash": ""
  1721. },
  1722. {
  1723. "input": "test",
  1724. "base": "file:///tmp/mock/path",
  1725. "href": "file:///tmp/mock/test",
  1726. "protocol": "file:",
  1727. "username": "",
  1728. "password": "",
  1729. "host": "",
  1730. "hostname": "",
  1731. "port": "",
  1732. "pathname": "/tmp/mock/test",
  1733. "search": "",
  1734. "hash": ""
  1735. },
  1736. {
  1737. "input": "file:test",
  1738. "base": "file:///tmp/mock/path",
  1739. "href": "file:///tmp/mock/test",
  1740. "protocol": "file:",
  1741. "username": "",
  1742. "password": "",
  1743. "host": "",
  1744. "hostname": "",
  1745. "port": "",
  1746. "pathname": "/tmp/mock/test",
  1747. "search": "",
  1748. "hash": ""
  1749. },
  1750. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
  1751. {
  1752. "input": "http://example.com/././foo",
  1753. "base": "about:blank",
  1754. "href": "http://example.com/foo",
  1755. "origin": "http://example.com",
  1756. "protocol": "http:",
  1757. "username": "",
  1758. "password": "",
  1759. "host": "example.com",
  1760. "hostname": "example.com",
  1761. "port": "",
  1762. "pathname": "/foo",
  1763. "search": "",
  1764. "hash": ""
  1765. },
  1766. {
  1767. "input": "http://example.com/./.foo",
  1768. "base": "about:blank",
  1769. "href": "http://example.com/.foo",
  1770. "origin": "http://example.com",
  1771. "protocol": "http:",
  1772. "username": "",
  1773. "password": "",
  1774. "host": "example.com",
  1775. "hostname": "example.com",
  1776. "port": "",
  1777. "pathname": "/.foo",
  1778. "search": "",
  1779. "hash": ""
  1780. },
  1781. {
  1782. "input": "http://example.com/foo/.",
  1783. "base": "about:blank",
  1784. "href": "http://example.com/foo/",
  1785. "origin": "http://example.com",
  1786. "protocol": "http:",
  1787. "username": "",
  1788. "password": "",
  1789. "host": "example.com",
  1790. "hostname": "example.com",
  1791. "port": "",
  1792. "pathname": "/foo/",
  1793. "search": "",
  1794. "hash": ""
  1795. },
  1796. {
  1797. "input": "http://example.com/foo/./",
  1798. "base": "about:blank",
  1799. "href": "http://example.com/foo/",
  1800. "origin": "http://example.com",
  1801. "protocol": "http:",
  1802. "username": "",
  1803. "password": "",
  1804. "host": "example.com",
  1805. "hostname": "example.com",
  1806. "port": "",
  1807. "pathname": "/foo/",
  1808. "search": "",
  1809. "hash": ""
  1810. },
  1811. {
  1812. "input": "http://example.com/foo/bar/..",
  1813. "base": "about:blank",
  1814. "href": "http://example.com/foo/",
  1815. "origin": "http://example.com",
  1816. "protocol": "http:",
  1817. "username": "",
  1818. "password": "",
  1819. "host": "example.com",
  1820. "hostname": "example.com",
  1821. "port": "",
  1822. "pathname": "/foo/",
  1823. "search": "",
  1824. "hash": ""
  1825. },
  1826. {
  1827. "input": "http://example.com/foo/bar/../",
  1828. "base": "about:blank",
  1829. "href": "http://example.com/foo/",
  1830. "origin": "http://example.com",
  1831. "protocol": "http:",
  1832. "username": "",
  1833. "password": "",
  1834. "host": "example.com",
  1835. "hostname": "example.com",
  1836. "port": "",
  1837. "pathname": "/foo/",
  1838. "search": "",
  1839. "hash": ""
  1840. },
  1841. {
  1842. "input": "http://example.com/foo/..bar",
  1843. "base": "about:blank",
  1844. "href": "http://example.com/foo/..bar",
  1845. "origin": "http://example.com",
  1846. "protocol": "http:",
  1847. "username": "",
  1848. "password": "",
  1849. "host": "example.com",
  1850. "hostname": "example.com",
  1851. "port": "",
  1852. "pathname": "/foo/..bar",
  1853. "search": "",
  1854. "hash": ""
  1855. },
  1856. {
  1857. "input": "http://example.com/foo/bar/../ton",
  1858. "base": "about:blank",
  1859. "href": "http://example.com/foo/ton",
  1860. "origin": "http://example.com",
  1861. "protocol": "http:",
  1862. "username": "",
  1863. "password": "",
  1864. "host": "example.com",
  1865. "hostname": "example.com",
  1866. "port": "",
  1867. "pathname": "/foo/ton",
  1868. "search": "",
  1869. "hash": ""
  1870. },
  1871. {
  1872. "input": "http://example.com/foo/bar/../ton/../../a",
  1873. "base": "about:blank",
  1874. "href": "http://example.com/a",
  1875. "origin": "http://example.com",
  1876. "protocol": "http:",
  1877. "username": "",
  1878. "password": "",
  1879. "host": "example.com",
  1880. "hostname": "example.com",
  1881. "port": "",
  1882. "pathname": "/a",
  1883. "search": "",
  1884. "hash": ""
  1885. },
  1886. {
  1887. "input": "http://example.com/foo/../../..",
  1888. "base": "about:blank",
  1889. "href": "http://example.com/",
  1890. "origin": "http://example.com",
  1891. "protocol": "http:",
  1892. "username": "",
  1893. "password": "",
  1894. "host": "example.com",
  1895. "hostname": "example.com",
  1896. "port": "",
  1897. "pathname": "/",
  1898. "search": "",
  1899. "hash": ""
  1900. },
  1901. {
  1902. "input": "http://example.com/foo/../../../ton",
  1903. "base": "about:blank",
  1904. "href": "http://example.com/ton",
  1905. "origin": "http://example.com",
  1906. "protocol": "http:",
  1907. "username": "",
  1908. "password": "",
  1909. "host": "example.com",
  1910. "hostname": "example.com",
  1911. "port": "",
  1912. "pathname": "/ton",
  1913. "search": "",
  1914. "hash": ""
  1915. },
  1916. {
  1917. "input": "http://example.com/foo/%2e",
  1918. "base": "about:blank",
  1919. "href": "http://example.com/foo/",
  1920. "origin": "http://example.com",
  1921. "protocol": "http:",
  1922. "username": "",
  1923. "password": "",
  1924. "host": "example.com",
  1925. "hostname": "example.com",
  1926. "port": "",
  1927. "pathname": "/foo/",
  1928. "search": "",
  1929. "hash": ""
  1930. },
  1931. {
  1932. "input": "http://example.com/foo/%2e%2",
  1933. "base": "about:blank",
  1934. "href": "http://example.com/foo/%2e%2",
  1935. "origin": "http://example.com",
  1936. "protocol": "http:",
  1937. "username": "",
  1938. "password": "",
  1939. "host": "example.com",
  1940. "hostname": "example.com",
  1941. "port": "",
  1942. "pathname": "/foo/%2e%2",
  1943. "search": "",
  1944. "hash": ""
  1945. },
  1946. {
  1947. "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
  1948. "base": "about:blank",
  1949. "href": "http://example.com/%2e.bar",
  1950. "origin": "http://example.com",
  1951. "protocol": "http:",
  1952. "username": "",
  1953. "password": "",
  1954. "host": "example.com",
  1955. "hostname": "example.com",
  1956. "port": "",
  1957. "pathname": "/%2e.bar",
  1958. "search": "",
  1959. "hash": ""
  1960. },
  1961. {
  1962. "input": "http://example.com////../..",
  1963. "base": "about:blank",
  1964. "href": "http://example.com//",
  1965. "origin": "http://example.com",
  1966. "protocol": "http:",
  1967. "username": "",
  1968. "password": "",
  1969. "host": "example.com",
  1970. "hostname": "example.com",
  1971. "port": "",
  1972. "pathname": "//",
  1973. "search": "",
  1974. "hash": ""
  1975. },
  1976. {
  1977. "input": "http://example.com/foo/bar//../..",
  1978. "base": "about:blank",
  1979. "href": "http://example.com/foo/",
  1980. "origin": "http://example.com",
  1981. "protocol": "http:",
  1982. "username": "",
  1983. "password": "",
  1984. "host": "example.com",
  1985. "hostname": "example.com",
  1986. "port": "",
  1987. "pathname": "/foo/",
  1988. "search": "",
  1989. "hash": ""
  1990. },
  1991. {
  1992. "input": "http://example.com/foo/bar//..",
  1993. "base": "about:blank",
  1994. "href": "http://example.com/foo/bar/",
  1995. "origin": "http://example.com",
  1996. "protocol": "http:",
  1997. "username": "",
  1998. "password": "",
  1999. "host": "example.com",
  2000. "hostname": "example.com",
  2001. "port": "",
  2002. "pathname": "/foo/bar/",
  2003. "search": "",
  2004. "hash": ""
  2005. },
  2006. {
  2007. "input": "http://example.com/foo",
  2008. "base": "about:blank",
  2009. "href": "http://example.com/foo",
  2010. "origin": "http://example.com",
  2011. "protocol": "http:",
  2012. "username": "",
  2013. "password": "",
  2014. "host": "example.com",
  2015. "hostname": "example.com",
  2016. "port": "",
  2017. "pathname": "/foo",
  2018. "search": "",
  2019. "hash": ""
  2020. },
  2021. {
  2022. "input": "http://example.com/%20foo",
  2023. "base": "about:blank",
  2024. "href": "http://example.com/%20foo",
  2025. "origin": "http://example.com",
  2026. "protocol": "http:",
  2027. "username": "",
  2028. "password": "",
  2029. "host": "example.com",
  2030. "hostname": "example.com",
  2031. "port": "",
  2032. "pathname": "/%20foo",
  2033. "search": "",
  2034. "hash": ""
  2035. },
  2036. {
  2037. "input": "http://example.com/foo%",
  2038. "base": "about:blank",
  2039. "href": "http://example.com/foo%",
  2040. "origin": "http://example.com",
  2041. "protocol": "http:",
  2042. "username": "",
  2043. "password": "",
  2044. "host": "example.com",
  2045. "hostname": "example.com",
  2046. "port": "",
  2047. "pathname": "/foo%",
  2048. "search": "",
  2049. "hash": ""
  2050. },
  2051. {
  2052. "input": "http://example.com/foo%2",
  2053. "base": "about:blank",
  2054. "href": "http://example.com/foo%2",
  2055. "origin": "http://example.com",
  2056. "protocol": "http:",
  2057. "username": "",
  2058. "password": "",
  2059. "host": "example.com",
  2060. "hostname": "example.com",
  2061. "port": "",
  2062. "pathname": "/foo%2",
  2063. "search": "",
  2064. "hash": ""
  2065. },
  2066. {
  2067. "input": "http://example.com/foo%2zbar",
  2068. "base": "about:blank",
  2069. "href": "http://example.com/foo%2zbar",
  2070. "origin": "http://example.com",
  2071. "protocol": "http:",
  2072. "username": "",
  2073. "password": "",
  2074. "host": "example.com",
  2075. "hostname": "example.com",
  2076. "port": "",
  2077. "pathname": "/foo%2zbar",
  2078. "search": "",
  2079. "hash": ""
  2080. },
  2081. {
  2082. "input": "http://example.com/foo%2©zbar",
  2083. "base": "about:blank",
  2084. "href": "http://example.com/foo%2%C3%82%C2%A9zbar",
  2085. "origin": "http://example.com",
  2086. "protocol": "http:",
  2087. "username": "",
  2088. "password": "",
  2089. "host": "example.com",
  2090. "hostname": "example.com",
  2091. "port": "",
  2092. "pathname": "/foo%2%C3%82%C2%A9zbar",
  2093. "search": "",
  2094. "hash": ""
  2095. },
  2096. {
  2097. "input": "http://example.com/foo%41%7a",
  2098. "base": "about:blank",
  2099. "href": "http://example.com/foo%41%7a",
  2100. "origin": "http://example.com",
  2101. "protocol": "http:",
  2102. "username": "",
  2103. "password": "",
  2104. "host": "example.com",
  2105. "hostname": "example.com",
  2106. "port": "",
  2107. "pathname": "/foo%41%7a",
  2108. "search": "",
  2109. "hash": ""
  2110. },
  2111. {
  2112. "input": "http://example.com/foo\t\u0091%91",
  2113. "base": "about:blank",
  2114. "href": "http://example.com/foo%C2%91%91",
  2115. "origin": "http://example.com",
  2116. "protocol": "http:",
  2117. "username": "",
  2118. "password": "",
  2119. "host": "example.com",
  2120. "hostname": "example.com",
  2121. "port": "",
  2122. "pathname": "/foo%C2%91%91",
  2123. "search": "",
  2124. "hash": ""
  2125. },
  2126. {
  2127. "input": "http://example.com/foo%00%51",
  2128. "base": "about:blank",
  2129. "href": "http://example.com/foo%00%51",
  2130. "origin": "http://example.com",
  2131. "protocol": "http:",
  2132. "username": "",
  2133. "password": "",
  2134. "host": "example.com",
  2135. "hostname": "example.com",
  2136. "port": "",
  2137. "pathname": "/foo%00%51",
  2138. "search": "",
  2139. "hash": ""
  2140. },
  2141. {
  2142. "input": "http://example.com/(%28:%3A%29)",
  2143. "base": "about:blank",
  2144. "href": "http://example.com/(%28:%3A%29)",
  2145. "origin": "http://example.com",
  2146. "protocol": "http:",
  2147. "username": "",
  2148. "password": "",
  2149. "host": "example.com",
  2150. "hostname": "example.com",
  2151. "port": "",
  2152. "pathname": "/(%28:%3A%29)",
  2153. "search": "",
  2154. "hash": ""
  2155. },
  2156. {
  2157. "input": "http://example.com/%3A%3a%3C%3c",
  2158. "base": "about:blank",
  2159. "href": "http://example.com/%3A%3a%3C%3c",
  2160. "origin": "http://example.com",
  2161. "protocol": "http:",
  2162. "username": "",
  2163. "password": "",
  2164. "host": "example.com",
  2165. "hostname": "example.com",
  2166. "port": "",
  2167. "pathname": "/%3A%3a%3C%3c",
  2168. "search": "",
  2169. "hash": ""
  2170. },
  2171. {
  2172. "input": "http://example.com/foo\tbar",
  2173. "base": "about:blank",
  2174. "href": "http://example.com/foobar",
  2175. "origin": "http://example.com",
  2176. "protocol": "http:",
  2177. "username": "",
  2178. "password": "",
  2179. "host": "example.com",
  2180. "hostname": "example.com",
  2181. "port": "",
  2182. "pathname": "/foobar",
  2183. "search": "",
  2184. "hash": ""
  2185. },
  2186. {
  2187. "input": "http://example.com\\\\foo\\\\bar",
  2188. "base": "about:blank",
  2189. "href": "http://example.com//foo//bar",
  2190. "origin": "http://example.com",
  2191. "protocol": "http:",
  2192. "username": "",
  2193. "password": "",
  2194. "host": "example.com",
  2195. "hostname": "example.com",
  2196. "port": "",
  2197. "pathname": "//foo//bar",
  2198. "search": "",
  2199. "hash": ""
  2200. },
  2201. {
  2202. "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2203. "base": "about:blank",
  2204. "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2205. "origin": "http://example.com",
  2206. "protocol": "http:",
  2207. "username": "",
  2208. "password": "",
  2209. "host": "example.com",
  2210. "hostname": "example.com",
  2211. "port": "",
  2212. "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2213. "search": "",
  2214. "hash": ""
  2215. },
  2216. {
  2217. "input": "http://example.com/@asdf%40",
  2218. "base": "about:blank",
  2219. "href": "http://example.com/@asdf%40",
  2220. "origin": "http://example.com",
  2221. "protocol": "http:",
  2222. "username": "",
  2223. "password": "",
  2224. "host": "example.com",
  2225. "hostname": "example.com",
  2226. "port": "",
  2227. "pathname": "/@asdf%40",
  2228. "search": "",
  2229. "hash": ""
  2230. },
  2231. {
  2232. "input": "http://example.com/你好你好",
  2233. "base": "about:blank",
  2234. "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2235. "origin": "http://example.com",
  2236. "protocol": "http:",
  2237. "username": "",
  2238. "password": "",
  2239. "host": "example.com",
  2240. "hostname": "example.com",
  2241. "port": "",
  2242. "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2243. "search": "",
  2244. "hash": ""
  2245. },
  2246. {
  2247. "input": "http://example.com/‥/foo",
  2248. "base": "about:blank",
  2249. "href": "http://example.com/%E2%80%A5/foo",
  2250. "origin": "http://example.com",
  2251. "protocol": "http:",
  2252. "username": "",
  2253. "password": "",
  2254. "host": "example.com",
  2255. "hostname": "example.com",
  2256. "port": "",
  2257. "pathname": "/%E2%80%A5/foo",
  2258. "search": "",
  2259. "hash": ""
  2260. },
  2261. {
  2262. "input": "http://example.com//foo",
  2263. "base": "about:blank",
  2264. "href": "http://example.com/%EF%BB%BF/foo",
  2265. "origin": "http://example.com",
  2266. "protocol": "http:",
  2267. "username": "",
  2268. "password": "",
  2269. "host": "example.com",
  2270. "hostname": "example.com",
  2271. "port": "",
  2272. "pathname": "/%EF%BB%BF/foo",
  2273. "search": "",
  2274. "hash": ""
  2275. },
  2276. {
  2277. "input": "http://example.com/‮/foo/‭/bar",
  2278. "base": "about:blank",
  2279. "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar",
  2280. "origin": "http://example.com",
  2281. "protocol": "http:",
  2282. "username": "",
  2283. "password": "",
  2284. "host": "example.com",
  2285. "hostname": "example.com",
  2286. "port": "",
  2287. "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
  2288. "search": "",
  2289. "hash": ""
  2290. },
  2291. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js",
  2292. {
  2293. "input": "http://www.google.com/foo?bar=baz#",
  2294. "base": "about:blank",
  2295. "href": "http://www.google.com/foo?bar=baz#",
  2296. "origin": "http://www.google.com",
  2297. "protocol": "http:",
  2298. "username": "",
  2299. "password": "",
  2300. "host": "www.google.com",
  2301. "hostname": "www.google.com",
  2302. "port": "",
  2303. "pathname": "/foo",
  2304. "search": "?bar=baz",
  2305. "hash": ""
  2306. },
  2307. {
  2308. "input": "http://www.google.com/foo?bar=baz# »",
  2309. "base": "about:blank",
  2310. "href": "http://www.google.com/foo?bar=baz#%20%C2%BB",
  2311. "origin": "http://www.google.com",
  2312. "protocol": "http:",
  2313. "username": "",
  2314. "password": "",
  2315. "host": "www.google.com",
  2316. "hostname": "www.google.com",
  2317. "port": "",
  2318. "pathname": "/foo",
  2319. "search": "?bar=baz",
  2320. "hash": "#%20%C2%BB"
  2321. },
  2322. {
  2323. "input": "data:test# »",
  2324. "base": "about:blank",
  2325. "href": "data:test#%20%C2%BB",
  2326. "origin": "null",
  2327. "protocol": "data:",
  2328. "username": "",
  2329. "password": "",
  2330. "host": "",
  2331. "hostname": "",
  2332. "port": "",
  2333. "pathname": "test",
  2334. "search": "",
  2335. "hash": "#%20%C2%BB"
  2336. },
  2337. {
  2338. "input": "http://www.google.com",
  2339. "base": "about:blank",
  2340. "href": "http://www.google.com/",
  2341. "origin": "http://www.google.com",
  2342. "protocol": "http:",
  2343. "username": "",
  2344. "password": "",
  2345. "host": "www.google.com",
  2346. "hostname": "www.google.com",
  2347. "port": "",
  2348. "pathname": "/",
  2349. "search": "",
  2350. "hash": ""
  2351. },
  2352. {
  2353. "input": "http://192.0x00A80001",
  2354. "base": "about:blank",
  2355. "href": "http://192.168.0.1/",
  2356. "origin": "http://192.168.0.1",
  2357. "protocol": "http:",
  2358. "username": "",
  2359. "password": "",
  2360. "host": "192.168.0.1",
  2361. "hostname": "192.168.0.1",
  2362. "port": "",
  2363. "pathname": "/",
  2364. "search": "",
  2365. "hash": ""
  2366. },
  2367. {
  2368. "input": "http://www/foo%2Ehtml",
  2369. "base": "about:blank",
  2370. "href": "http://www/foo%2Ehtml",
  2371. "origin": "http://www",
  2372. "protocol": "http:",
  2373. "username": "",
  2374. "password": "",
  2375. "host": "www",
  2376. "hostname": "www",
  2377. "port": "",
  2378. "pathname": "/foo%2Ehtml",
  2379. "search": "",
  2380. "hash": ""
  2381. },
  2382. {
  2383. "input": "http://www/foo/%2E/html",
  2384. "base": "about:blank",
  2385. "href": "http://www/foo/html",
  2386. "origin": "http://www",
  2387. "protocol": "http:",
  2388. "username": "",
  2389. "password": "",
  2390. "host": "www",
  2391. "hostname": "www",
  2392. "port": "",
  2393. "pathname": "/foo/html",
  2394. "search": "",
  2395. "hash": ""
  2396. },
  2397. {
  2398. "input": "http://user:pass@/",
  2399. "base": "about:blank",
  2400. "failure": true
  2401. },
  2402. {
  2403. "input": "http://%25DOMAIN:foobar@foodomain.com/",
  2404. "base": "about:blank",
  2405. "href": "http://%25DOMAIN:foobar@foodomain.com/",
  2406. "origin": "http://foodomain.com",
  2407. "protocol": "http:",
  2408. "username": "%25DOMAIN",
  2409. "password": "foobar",
  2410. "host": "foodomain.com",
  2411. "hostname": "foodomain.com",
  2412. "port": "",
  2413. "pathname": "/",
  2414. "search": "",
  2415. "hash": ""
  2416. },
  2417. {
  2418. "input": "http:\\\\www.google.com\\foo",
  2419. "base": "about:blank",
  2420. "href": "http://www.google.com/foo",
  2421. "origin": "http://www.google.com",
  2422. "protocol": "http:",
  2423. "username": "",
  2424. "password": "",
  2425. "host": "www.google.com",
  2426. "hostname": "www.google.com",
  2427. "port": "",
  2428. "pathname": "/foo",
  2429. "search": "",
  2430. "hash": ""
  2431. },
  2432. {
  2433. "input": "http://foo:80/",
  2434. "base": "about:blank",
  2435. "href": "http://foo/",
  2436. "origin": "http://foo",
  2437. "protocol": "http:",
  2438. "username": "",
  2439. "password": "",
  2440. "host": "foo",
  2441. "hostname": "foo",
  2442. "port": "",
  2443. "pathname": "/",
  2444. "search": "",
  2445. "hash": ""
  2446. },
  2447. {
  2448. "input": "http://foo:81/",
  2449. "base": "about:blank",
  2450. "href": "http://foo:81/",
  2451. "origin": "http://foo:81",
  2452. "protocol": "http:",
  2453. "username": "",
  2454. "password": "",
  2455. "host": "foo:81",
  2456. "hostname": "foo",
  2457. "port": "81",
  2458. "pathname": "/",
  2459. "search": "",
  2460. "hash": ""
  2461. },
  2462. {
  2463. "input": "httpa://foo:80/",
  2464. "base": "about:blank",
  2465. "href": "httpa://foo:80/",
  2466. "origin": "null",
  2467. "protocol": "httpa:",
  2468. "username": "",
  2469. "password": "",
  2470. "host": "foo:80",
  2471. "hostname": "foo",
  2472. "port": "80",
  2473. "pathname": "/",
  2474. "search": "",
  2475. "hash": ""
  2476. },
  2477. {
  2478. "input": "http://foo:-80/",
  2479. "base": "about:blank",
  2480. "failure": true
  2481. },
  2482. {
  2483. "input": "https://foo:443/",
  2484. "base": "about:blank",
  2485. "href": "https://foo/",
  2486. "origin": "https://foo",
  2487. "protocol": "https:",
  2488. "username": "",
  2489. "password": "",
  2490. "host": "foo",
  2491. "hostname": "foo",
  2492. "port": "",
  2493. "pathname": "/",
  2494. "search": "",
  2495. "hash": ""
  2496. },
  2497. {
  2498. "input": "https://foo:80/",
  2499. "base": "about:blank",
  2500. "href": "https://foo:80/",
  2501. "origin": "https://foo:80",
  2502. "protocol": "https:",
  2503. "username": "",
  2504. "password": "",
  2505. "host": "foo:80",
  2506. "hostname": "foo",
  2507. "port": "80",
  2508. "pathname": "/",
  2509. "search": "",
  2510. "hash": ""
  2511. },
  2512. {
  2513. "input": "ftp://foo:21/",
  2514. "base": "about:blank",
  2515. "href": "ftp://foo/",
  2516. "origin": "ftp://foo",
  2517. "protocol": "ftp:",
  2518. "username": "",
  2519. "password": "",
  2520. "host": "foo",
  2521. "hostname": "foo",
  2522. "port": "",
  2523. "pathname": "/",
  2524. "search": "",
  2525. "hash": ""
  2526. },
  2527. {
  2528. "input": "ftp://foo:80/",
  2529. "base": "about:blank",
  2530. "href": "ftp://foo:80/",
  2531. "origin": "ftp://foo:80",
  2532. "protocol": "ftp:",
  2533. "username": "",
  2534. "password": "",
  2535. "host": "foo:80",
  2536. "hostname": "foo",
  2537. "port": "80",
  2538. "pathname": "/",
  2539. "search": "",
  2540. "hash": ""
  2541. },
  2542. {
  2543. "input": "gopher://foo:70/",
  2544. "base": "about:blank",
  2545. "href": "gopher://foo:70/",
  2546. "origin": "null",
  2547. "protocol": "gopher:",
  2548. "username": "",
  2549. "password": "",
  2550. "host": "foo:70",
  2551. "hostname": "foo",
  2552. "port": "70",
  2553. "pathname": "/",
  2554. "search": "",
  2555. "hash": ""
  2556. },
  2557. {
  2558. "input": "gopher://foo:443/",
  2559. "base": "about:blank",
  2560. "href": "gopher://foo:443/",
  2561. "origin": "null",
  2562. "protocol": "gopher:",
  2563. "username": "",
  2564. "password": "",
  2565. "host": "foo:443",
  2566. "hostname": "foo",
  2567. "port": "443",
  2568. "pathname": "/",
  2569. "search": "",
  2570. "hash": ""
  2571. },
  2572. {
  2573. "input": "ws://foo:80/",
  2574. "base": "about:blank",
  2575. "href": "ws://foo/",
  2576. "origin": "ws://foo",
  2577. "protocol": "ws:",
  2578. "username": "",
  2579. "password": "",
  2580. "host": "foo",
  2581. "hostname": "foo",
  2582. "port": "",
  2583. "pathname": "/",
  2584. "search": "",
  2585. "hash": ""
  2586. },
  2587. {
  2588. "input": "ws://foo:81/",
  2589. "base": "about:blank",
  2590. "href": "ws://foo:81/",
  2591. "origin": "ws://foo:81",
  2592. "protocol": "ws:",
  2593. "username": "",
  2594. "password": "",
  2595. "host": "foo:81",
  2596. "hostname": "foo",
  2597. "port": "81",
  2598. "pathname": "/",
  2599. "search": "",
  2600. "hash": ""
  2601. },
  2602. {
  2603. "input": "ws://foo:443/",
  2604. "base": "about:blank",
  2605. "href": "ws://foo:443/",
  2606. "origin": "ws://foo:443",
  2607. "protocol": "ws:",
  2608. "username": "",
  2609. "password": "",
  2610. "host": "foo:443",
  2611. "hostname": "foo",
  2612. "port": "443",
  2613. "pathname": "/",
  2614. "search": "",
  2615. "hash": ""
  2616. },
  2617. {
  2618. "input": "ws://foo:815/",
  2619. "base": "about:blank",
  2620. "href": "ws://foo:815/",
  2621. "origin": "ws://foo:815",
  2622. "protocol": "ws:",
  2623. "username": "",
  2624. "password": "",
  2625. "host": "foo:815",
  2626. "hostname": "foo",
  2627. "port": "815",
  2628. "pathname": "/",
  2629. "search": "",
  2630. "hash": ""
  2631. },
  2632. {
  2633. "input": "wss://foo:80/",
  2634. "base": "about:blank",
  2635. "href": "wss://foo:80/",
  2636. "origin": "wss://foo:80",
  2637. "protocol": "wss:",
  2638. "username": "",
  2639. "password": "",
  2640. "host": "foo:80",
  2641. "hostname": "foo",
  2642. "port": "80",
  2643. "pathname": "/",
  2644. "search": "",
  2645. "hash": ""
  2646. },
  2647. {
  2648. "input": "wss://foo:81/",
  2649. "base": "about:blank",
  2650. "href": "wss://foo:81/",
  2651. "origin": "wss://foo:81",
  2652. "protocol": "wss:",
  2653. "username": "",
  2654. "password": "",
  2655. "host": "foo:81",
  2656. "hostname": "foo",
  2657. "port": "81",
  2658. "pathname": "/",
  2659. "search": "",
  2660. "hash": ""
  2661. },
  2662. {
  2663. "input": "wss://foo:443/",
  2664. "base": "about:blank",
  2665. "href": "wss://foo/",
  2666. "origin": "wss://foo",
  2667. "protocol": "wss:",
  2668. "username": "",
  2669. "password": "",
  2670. "host": "foo",
  2671. "hostname": "foo",
  2672. "port": "",
  2673. "pathname": "/",
  2674. "search": "",
  2675. "hash": ""
  2676. },
  2677. {
  2678. "input": "wss://foo:815/",
  2679. "base": "about:blank",
  2680. "href": "wss://foo:815/",
  2681. "origin": "wss://foo:815",
  2682. "protocol": "wss:",
  2683. "username": "",
  2684. "password": "",
  2685. "host": "foo:815",
  2686. "hostname": "foo",
  2687. "port": "815",
  2688. "pathname": "/",
  2689. "search": "",
  2690. "hash": ""
  2691. },
  2692. {
  2693. "input": "http:/example.com/",
  2694. "base": "about:blank",
  2695. "href": "http://example.com/",
  2696. "origin": "http://example.com",
  2697. "protocol": "http:",
  2698. "username": "",
  2699. "password": "",
  2700. "host": "example.com",
  2701. "hostname": "example.com",
  2702. "port": "",
  2703. "pathname": "/",
  2704. "search": "",
  2705. "hash": ""
  2706. },
  2707. {
  2708. "input": "ftp:/example.com/",
  2709. "base": "about:blank",
  2710. "href": "ftp://example.com/",
  2711. "origin": "ftp://example.com",
  2712. "protocol": "ftp:",
  2713. "username": "",
  2714. "password": "",
  2715. "host": "example.com",
  2716. "hostname": "example.com",
  2717. "port": "",
  2718. "pathname": "/",
  2719. "search": "",
  2720. "hash": ""
  2721. },
  2722. {
  2723. "input": "https:/example.com/",
  2724. "base": "about:blank",
  2725. "href": "https://example.com/",
  2726. "origin": "https://example.com",
  2727. "protocol": "https:",
  2728. "username": "",
  2729. "password": "",
  2730. "host": "example.com",
  2731. "hostname": "example.com",
  2732. "port": "",
  2733. "pathname": "/",
  2734. "search": "",
  2735. "hash": ""
  2736. },
  2737. {
  2738. "input": "madeupscheme:/example.com/",
  2739. "base": "about:blank",
  2740. "href": "madeupscheme:/example.com/",
  2741. "origin": "null",
  2742. "protocol": "madeupscheme:",
  2743. "username": "",
  2744. "password": "",
  2745. "host": "",
  2746. "hostname": "",
  2747. "port": "",
  2748. "pathname": "/example.com/",
  2749. "search": "",
  2750. "hash": ""
  2751. },
  2752. {
  2753. "input": "file:/example.com/",
  2754. "base": "about:blank",
  2755. "href": "file:///example.com/",
  2756. "protocol": "file:",
  2757. "username": "",
  2758. "password": "",
  2759. "host": "",
  2760. "hostname": "",
  2761. "port": "",
  2762. "pathname": "/example.com/",
  2763. "search": "",
  2764. "hash": ""
  2765. },
  2766. {
  2767. "input": "ftps:/example.com/",
  2768. "base": "about:blank",
  2769. "href": "ftps:/example.com/",
  2770. "origin": "null",
  2771. "protocol": "ftps:",
  2772. "username": "",
  2773. "password": "",
  2774. "host": "",
  2775. "hostname": "",
  2776. "port": "",
  2777. "pathname": "/example.com/",
  2778. "search": "",
  2779. "hash": ""
  2780. },
  2781. {
  2782. "input": "gopher:/example.com/",
  2783. "base": "about:blank",
  2784. "href": "gopher:/example.com/",
  2785. "origin": "null",
  2786. "protocol": "gopher:",
  2787. "username": "",
  2788. "password": "",
  2789. "host": "",
  2790. "hostname": "",
  2791. "port": "",
  2792. "pathname": "/example.com/",
  2793. "search": "",
  2794. "hash": ""
  2795. },
  2796. {
  2797. "input": "ws:/example.com/",
  2798. "base": "about:blank",
  2799. "href": "ws://example.com/",
  2800. "origin": "ws://example.com",
  2801. "protocol": "ws:",
  2802. "username": "",
  2803. "password": "",
  2804. "host": "example.com",
  2805. "hostname": "example.com",
  2806. "port": "",
  2807. "pathname": "/",
  2808. "search": "",
  2809. "hash": ""
  2810. },
  2811. {
  2812. "input": "wss:/example.com/",
  2813. "base": "about:blank",
  2814. "href": "wss://example.com/",
  2815. "origin": "wss://example.com",
  2816. "protocol": "wss:",
  2817. "username": "",
  2818. "password": "",
  2819. "host": "example.com",
  2820. "hostname": "example.com",
  2821. "port": "",
  2822. "pathname": "/",
  2823. "search": "",
  2824. "hash": ""
  2825. },
  2826. {
  2827. "input": "data:/example.com/",
  2828. "base": "about:blank",
  2829. "href": "data:/example.com/",
  2830. "origin": "null",
  2831. "protocol": "data:",
  2832. "username": "",
  2833. "password": "",
  2834. "host": "",
  2835. "hostname": "",
  2836. "port": "",
  2837. "pathname": "/example.com/",
  2838. "search": "",
  2839. "hash": ""
  2840. },
  2841. {
  2842. "input": "javascript:/example.com/",
  2843. "base": "about:blank",
  2844. "href": "javascript:/example.com/",
  2845. "origin": "null",
  2846. "protocol": "javascript:",
  2847. "username": "",
  2848. "password": "",
  2849. "host": "",
  2850. "hostname": "",
  2851. "port": "",
  2852. "pathname": "/example.com/",
  2853. "search": "",
  2854. "hash": ""
  2855. },
  2856. {
  2857. "input": "mailto:/example.com/",
  2858. "base": "about:blank",
  2859. "href": "mailto:/example.com/",
  2860. "origin": "null",
  2861. "protocol": "mailto:",
  2862. "username": "",
  2863. "password": "",
  2864. "host": "",
  2865. "hostname": "",
  2866. "port": "",
  2867. "pathname": "/example.com/",
  2868. "search": "",
  2869. "hash": ""
  2870. },
  2871. {
  2872. "input": "http:example.com/",
  2873. "base": "about:blank",
  2874. "href": "http://example.com/",
  2875. "origin": "http://example.com",
  2876. "protocol": "http:",
  2877. "username": "",
  2878. "password": "",
  2879. "host": "example.com",
  2880. "hostname": "example.com",
  2881. "port": "",
  2882. "pathname": "/",
  2883. "search": "",
  2884. "hash": ""
  2885. },
  2886. {
  2887. "input": "ftp:example.com/",
  2888. "base": "about:blank",
  2889. "href": "ftp://example.com/",
  2890. "origin": "ftp://example.com",
  2891. "protocol": "ftp:",
  2892. "username": "",
  2893. "password": "",
  2894. "host": "example.com",
  2895. "hostname": "example.com",
  2896. "port": "",
  2897. "pathname": "/",
  2898. "search": "",
  2899. "hash": ""
  2900. },
  2901. {
  2902. "input": "https:example.com/",
  2903. "base": "about:blank",
  2904. "href": "https://example.com/",
  2905. "origin": "https://example.com",
  2906. "protocol": "https:",
  2907. "username": "",
  2908. "password": "",
  2909. "host": "example.com",
  2910. "hostname": "example.com",
  2911. "port": "",
  2912. "pathname": "/",
  2913. "search": "",
  2914. "hash": ""
  2915. },
  2916. {
  2917. "input": "madeupscheme:example.com/",
  2918. "base": "about:blank",
  2919. "href": "madeupscheme:example.com/",
  2920. "origin": "null",
  2921. "protocol": "madeupscheme:",
  2922. "username": "",
  2923. "password": "",
  2924. "host": "",
  2925. "hostname": "",
  2926. "port": "",
  2927. "pathname": "example.com/",
  2928. "search": "",
  2929. "hash": ""
  2930. },
  2931. {
  2932. "input": "ftps:example.com/",
  2933. "base": "about:blank",
  2934. "href": "ftps:example.com/",
  2935. "origin": "null",
  2936. "protocol": "ftps:",
  2937. "username": "",
  2938. "password": "",
  2939. "host": "",
  2940. "hostname": "",
  2941. "port": "",
  2942. "pathname": "example.com/",
  2943. "search": "",
  2944. "hash": ""
  2945. },
  2946. {
  2947. "input": "gopher:example.com/",
  2948. "base": "about:blank",
  2949. "href": "gopher:example.com/",
  2950. "origin": "null",
  2951. "protocol": "gopher:",
  2952. "username": "",
  2953. "password": "",
  2954. "host": "",
  2955. "hostname": "",
  2956. "port": "",
  2957. "pathname": "example.com/",
  2958. "search": "",
  2959. "hash": ""
  2960. },
  2961. {
  2962. "input": "ws:example.com/",
  2963. "base": "about:blank",
  2964. "href": "ws://example.com/",
  2965. "origin": "ws://example.com",
  2966. "protocol": "ws:",
  2967. "username": "",
  2968. "password": "",
  2969. "host": "example.com",
  2970. "hostname": "example.com",
  2971. "port": "",
  2972. "pathname": "/",
  2973. "search": "",
  2974. "hash": ""
  2975. },
  2976. {
  2977. "input": "wss:example.com/",
  2978. "base": "about:blank",
  2979. "href": "wss://example.com/",
  2980. "origin": "wss://example.com",
  2981. "protocol": "wss:",
  2982. "username": "",
  2983. "password": "",
  2984. "host": "example.com",
  2985. "hostname": "example.com",
  2986. "port": "",
  2987. "pathname": "/",
  2988. "search": "",
  2989. "hash": ""
  2990. },
  2991. {
  2992. "input": "data:example.com/",
  2993. "base": "about:blank",
  2994. "href": "data:example.com/",
  2995. "origin": "null",
  2996. "protocol": "data:",
  2997. "username": "",
  2998. "password": "",
  2999. "host": "",
  3000. "hostname": "",
  3001. "port": "",
  3002. "pathname": "example.com/",
  3003. "search": "",
  3004. "hash": ""
  3005. },
  3006. {
  3007. "input": "javascript:example.com/",
  3008. "base": "about:blank",
  3009. "href": "javascript:example.com/",
  3010. "origin": "null",
  3011. "protocol": "javascript:",
  3012. "username": "",
  3013. "password": "",
  3014. "host": "",
  3015. "hostname": "",
  3016. "port": "",
  3017. "pathname": "example.com/",
  3018. "search": "",
  3019. "hash": ""
  3020. },
  3021. {
  3022. "input": "mailto:example.com/",
  3023. "base": "about:blank",
  3024. "href": "mailto:example.com/",
  3025. "origin": "null",
  3026. "protocol": "mailto:",
  3027. "username": "",
  3028. "password": "",
  3029. "host": "",
  3030. "hostname": "",
  3031. "port": "",
  3032. "pathname": "example.com/",
  3033. "search": "",
  3034. "hash": ""
  3035. },
  3036. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html",
  3037. {
  3038. "input": "http:@www.example.com",
  3039. "base": "about:blank",
  3040. "href": "http://www.example.com/",
  3041. "origin": "http://www.example.com",
  3042. "protocol": "http:",
  3043. "username": "",
  3044. "password": "",
  3045. "host": "www.example.com",
  3046. "hostname": "www.example.com",
  3047. "port": "",
  3048. "pathname": "/",
  3049. "search": "",
  3050. "hash": ""
  3051. },
  3052. {
  3053. "input": "http:/@www.example.com",
  3054. "base": "about:blank",
  3055. "href": "http://www.example.com/",
  3056. "origin": "http://www.example.com",
  3057. "protocol": "http:",
  3058. "username": "",
  3059. "password": "",
  3060. "host": "www.example.com",
  3061. "hostname": "www.example.com",
  3062. "port": "",
  3063. "pathname": "/",
  3064. "search": "",
  3065. "hash": ""
  3066. },
  3067. {
  3068. "input": "http://@www.example.com",
  3069. "base": "about:blank",
  3070. "href": "http://www.example.com/",
  3071. "origin": "http://www.example.com",
  3072. "protocol": "http:",
  3073. "username": "",
  3074. "password": "",
  3075. "host": "www.example.com",
  3076. "hostname": "www.example.com",
  3077. "port": "",
  3078. "pathname": "/",
  3079. "search": "",
  3080. "hash": ""
  3081. },
  3082. {
  3083. "input": "http:a:b@www.example.com",
  3084. "base": "about:blank",
  3085. "href": "http://a:b@www.example.com/",
  3086. "origin": "http://www.example.com",
  3087. "protocol": "http:",
  3088. "username": "a",
  3089. "password": "b",
  3090. "host": "www.example.com",
  3091. "hostname": "www.example.com",
  3092. "port": "",
  3093. "pathname": "/",
  3094. "search": "",
  3095. "hash": ""
  3096. },
  3097. {
  3098. "input": "http:/a:b@www.example.com",
  3099. "base": "about:blank",
  3100. "href": "http://a:b@www.example.com/",
  3101. "origin": "http://www.example.com",
  3102. "protocol": "http:",
  3103. "username": "a",
  3104. "password": "b",
  3105. "host": "www.example.com",
  3106. "hostname": "www.example.com",
  3107. "port": "",
  3108. "pathname": "/",
  3109. "search": "",
  3110. "hash": ""
  3111. },
  3112. {
  3113. "input": "http://a:b@www.example.com",
  3114. "base": "about:blank",
  3115. "href": "http://a:b@www.example.com/",
  3116. "origin": "http://www.example.com",
  3117. "protocol": "http:",
  3118. "username": "a",
  3119. "password": "b",
  3120. "host": "www.example.com",
  3121. "hostname": "www.example.com",
  3122. "port": "",
  3123. "pathname": "/",
  3124. "search": "",
  3125. "hash": ""
  3126. },
  3127. {
  3128. "input": "http://@pple.com",
  3129. "base": "about:blank",
  3130. "href": "http://pple.com/",
  3131. "origin": "http://pple.com",
  3132. "protocol": "http:",
  3133. "username": "",
  3134. "password": "",
  3135. "host": "pple.com",
  3136. "hostname": "pple.com",
  3137. "port": "",
  3138. "pathname": "/",
  3139. "search": "",
  3140. "hash": ""
  3141. },
  3142. {
  3143. "input": "http::b@www.example.com",
  3144. "base": "about:blank",
  3145. "href": "http://:b@www.example.com/",
  3146. "origin": "http://www.example.com",
  3147. "protocol": "http:",
  3148. "username": "",
  3149. "password": "b",
  3150. "host": "www.example.com",
  3151. "hostname": "www.example.com",
  3152. "port": "",
  3153. "pathname": "/",
  3154. "search": "",
  3155. "hash": ""
  3156. },
  3157. {
  3158. "input": "http:/:b@www.example.com",
  3159. "base": "about:blank",
  3160. "href": "http://:b@www.example.com/",
  3161. "origin": "http://www.example.com",
  3162. "protocol": "http:",
  3163. "username": "",
  3164. "password": "b",
  3165. "host": "www.example.com",
  3166. "hostname": "www.example.com",
  3167. "port": "",
  3168. "pathname": "/",
  3169. "search": "",
  3170. "hash": ""
  3171. },
  3172. {
  3173. "input": "http://:b@www.example.com",
  3174. "base": "about:blank",
  3175. "href": "http://:b@www.example.com/",
  3176. "origin": "http://www.example.com",
  3177. "protocol": "http:",
  3178. "username": "",
  3179. "password": "b",
  3180. "host": "www.example.com",
  3181. "hostname": "www.example.com",
  3182. "port": "",
  3183. "pathname": "/",
  3184. "search": "",
  3185. "hash": ""
  3186. },
  3187. {
  3188. "input": "http:/:@/www.example.com",
  3189. "base": "about:blank",
  3190. "failure": true,
  3191. "inputCanBeRelative": true
  3192. },
  3193. {
  3194. "input": "http://user@/www.example.com",
  3195. "base": "about:blank",
  3196. "failure": true
  3197. },
  3198. {
  3199. "input": "http:@/www.example.com",
  3200. "base": "about:blank",
  3201. "failure": true,
  3202. "inputCanBeRelative": true
  3203. },
  3204. {
  3205. "input": "http:/@/www.example.com",
  3206. "base": "about:blank",
  3207. "failure": true,
  3208. "inputCanBeRelative": true
  3209. },
  3210. {
  3211. "input": "http://@/www.example.com",
  3212. "base": "about:blank",
  3213. "failure": true
  3214. },
  3215. {
  3216. "input": "https:@/www.example.com",
  3217. "base": "about:blank",
  3218. "failure": true,
  3219. "inputCanBeRelative": true
  3220. },
  3221. {
  3222. "input": "http:a:b@/www.example.com",
  3223. "base": "about:blank",
  3224. "failure": true,
  3225. "inputCanBeRelative": true
  3226. },
  3227. {
  3228. "input": "http:/a:b@/www.example.com",
  3229. "base": "about:blank",
  3230. "failure": true,
  3231. "inputCanBeRelative": true
  3232. },
  3233. {
  3234. "input": "http://a:b@/www.example.com",
  3235. "base": "about:blank",
  3236. "failure": true
  3237. },
  3238. {
  3239. "input": "http::@/www.example.com",
  3240. "base": "about:blank",
  3241. "failure": true,
  3242. "inputCanBeRelative": true
  3243. },
  3244. {
  3245. "input": "http:a:@www.example.com",
  3246. "base": "about:blank",
  3247. "href": "http://a@www.example.com/",
  3248. "origin": "http://www.example.com",
  3249. "protocol": "http:",
  3250. "username": "a",
  3251. "password": "",
  3252. "host": "www.example.com",
  3253. "hostname": "www.example.com",
  3254. "port": "",
  3255. "pathname": "/",
  3256. "search": "",
  3257. "hash": ""
  3258. },
  3259. {
  3260. "input": "http:/a:@www.example.com",
  3261. "base": "about:blank",
  3262. "href": "http://a@www.example.com/",
  3263. "origin": "http://www.example.com",
  3264. "protocol": "http:",
  3265. "username": "a",
  3266. "password": "",
  3267. "host": "www.example.com",
  3268. "hostname": "www.example.com",
  3269. "port": "",
  3270. "pathname": "/",
  3271. "search": "",
  3272. "hash": ""
  3273. },
  3274. {
  3275. "input": "http://a:@www.example.com",
  3276. "base": "about:blank",
  3277. "href": "http://a@www.example.com/",
  3278. "origin": "http://www.example.com",
  3279. "protocol": "http:",
  3280. "username": "a",
  3281. "password": "",
  3282. "host": "www.example.com",
  3283. "hostname": "www.example.com",
  3284. "port": "",
  3285. "pathname": "/",
  3286. "search": "",
  3287. "hash": ""
  3288. },
  3289. {
  3290. "input": "http://www.@pple.com",
  3291. "base": "about:blank",
  3292. "href": "http://www.@pple.com/",
  3293. "origin": "http://pple.com",
  3294. "protocol": "http:",
  3295. "username": "www.",
  3296. "password": "",
  3297. "host": "pple.com",
  3298. "hostname": "pple.com",
  3299. "port": "",
  3300. "pathname": "/",
  3301. "search": "",
  3302. "hash": ""
  3303. },
  3304. {
  3305. "input": "http:@:www.example.com",
  3306. "base": "about:blank",
  3307. "failure": true,
  3308. "inputCanBeRelative": true
  3309. },
  3310. {
  3311. "input": "http:/@:www.example.com",
  3312. "base": "about:blank",
  3313. "failure": true,
  3314. "inputCanBeRelative": true
  3315. },
  3316. {
  3317. "input": "http://@:www.example.com",
  3318. "base": "about:blank",
  3319. "failure": true
  3320. },
  3321. {
  3322. "input": "http://:@www.example.com",
  3323. "base": "about:blank",
  3324. "href": "http://www.example.com/",
  3325. "origin": "http://www.example.com",
  3326. "protocol": "http:",
  3327. "username": "",
  3328. "password": "",
  3329. "host": "www.example.com",
  3330. "hostname": "www.example.com",
  3331. "port": "",
  3332. "pathname": "/",
  3333. "search": "",
  3334. "hash": ""
  3335. },
  3336. "# Others",
  3337. {
  3338. "input": "/",
  3339. "base": "http://www.example.com/test",
  3340. "href": "http://www.example.com/",
  3341. "origin": "http://www.example.com",
  3342. "protocol": "http:",
  3343. "username": "",
  3344. "password": "",
  3345. "host": "www.example.com",
  3346. "hostname": "www.example.com",
  3347. "port": "",
  3348. "pathname": "/",
  3349. "search": "",
  3350. "hash": ""
  3351. },
  3352. {
  3353. "input": "/test.txt",
  3354. "base": "http://www.example.com/test",
  3355. "href": "http://www.example.com/test.txt",
  3356. "origin": "http://www.example.com",
  3357. "protocol": "http:",
  3358. "username": "",
  3359. "password": "",
  3360. "host": "www.example.com",
  3361. "hostname": "www.example.com",
  3362. "port": "",
  3363. "pathname": "/test.txt",
  3364. "search": "",
  3365. "hash": ""
  3366. },
  3367. {
  3368. "input": ".",
  3369. "base": "http://www.example.com/test",
  3370. "href": "http://www.example.com/",
  3371. "origin": "http://www.example.com",
  3372. "protocol": "http:",
  3373. "username": "",
  3374. "password": "",
  3375. "host": "www.example.com",
  3376. "hostname": "www.example.com",
  3377. "port": "",
  3378. "pathname": "/",
  3379. "search": "",
  3380. "hash": ""
  3381. },
  3382. {
  3383. "input": "..",
  3384. "base": "http://www.example.com/test",
  3385. "href": "http://www.example.com/",
  3386. "origin": "http://www.example.com",
  3387. "protocol": "http:",
  3388. "username": "",
  3389. "password": "",
  3390. "host": "www.example.com",
  3391. "hostname": "www.example.com",
  3392. "port": "",
  3393. "pathname": "/",
  3394. "search": "",
  3395. "hash": ""
  3396. },
  3397. {
  3398. "input": "test.txt",
  3399. "base": "http://www.example.com/test",
  3400. "href": "http://www.example.com/test.txt",
  3401. "origin": "http://www.example.com",
  3402. "protocol": "http:",
  3403. "username": "",
  3404. "password": "",
  3405. "host": "www.example.com",
  3406. "hostname": "www.example.com",
  3407. "port": "",
  3408. "pathname": "/test.txt",
  3409. "search": "",
  3410. "hash": ""
  3411. },
  3412. {
  3413. "input": "./test.txt",
  3414. "base": "http://www.example.com/test",
  3415. "href": "http://www.example.com/test.txt",
  3416. "origin": "http://www.example.com",
  3417. "protocol": "http:",
  3418. "username": "",
  3419. "password": "",
  3420. "host": "www.example.com",
  3421. "hostname": "www.example.com",
  3422. "port": "",
  3423. "pathname": "/test.txt",
  3424. "search": "",
  3425. "hash": ""
  3426. },
  3427. {
  3428. "input": "../test.txt",
  3429. "base": "http://www.example.com/test",
  3430. "href": "http://www.example.com/test.txt",
  3431. "origin": "http://www.example.com",
  3432. "protocol": "http:",
  3433. "username": "",
  3434. "password": "",
  3435. "host": "www.example.com",
  3436. "hostname": "www.example.com",
  3437. "port": "",
  3438. "pathname": "/test.txt",
  3439. "search": "",
  3440. "hash": ""
  3441. },
  3442. {
  3443. "input": "../aaa/test.txt",
  3444. "base": "http://www.example.com/test",
  3445. "href": "http://www.example.com/aaa/test.txt",
  3446. "origin": "http://www.example.com",
  3447. "protocol": "http:",
  3448. "username": "",
  3449. "password": "",
  3450. "host": "www.example.com",
  3451. "hostname": "www.example.com",
  3452. "port": "",
  3453. "pathname": "/aaa/test.txt",
  3454. "search": "",
  3455. "hash": ""
  3456. },
  3457. {
  3458. "input": "../../test.txt",
  3459. "base": "http://www.example.com/test",
  3460. "href": "http://www.example.com/test.txt",
  3461. "origin": "http://www.example.com",
  3462. "protocol": "http:",
  3463. "username": "",
  3464. "password": "",
  3465. "host": "www.example.com",
  3466. "hostname": "www.example.com",
  3467. "port": "",
  3468. "pathname": "/test.txt",
  3469. "search": "",
  3470. "hash": ""
  3471. },
  3472. {
  3473. "input": "中/test.txt",
  3474. "base": "http://www.example.com/test",
  3475. "href": "http://www.example.com/%E4%B8%AD/test.txt",
  3476. "origin": "http://www.example.com",
  3477. "protocol": "http:",
  3478. "username": "",
  3479. "password": "",
  3480. "host": "www.example.com",
  3481. "hostname": "www.example.com",
  3482. "port": "",
  3483. "pathname": "/%E4%B8%AD/test.txt",
  3484. "search": "",
  3485. "hash": ""
  3486. },
  3487. {
  3488. "input": "http://www.example2.com",
  3489. "base": "http://www.example.com/test",
  3490. "href": "http://www.example2.com/",
  3491. "origin": "http://www.example2.com",
  3492. "protocol": "http:",
  3493. "username": "",
  3494. "password": "",
  3495. "host": "www.example2.com",
  3496. "hostname": "www.example2.com",
  3497. "port": "",
  3498. "pathname": "/",
  3499. "search": "",
  3500. "hash": ""
  3501. },
  3502. {
  3503. "input": "//www.example2.com",
  3504. "base": "http://www.example.com/test",
  3505. "href": "http://www.example2.com/",
  3506. "origin": "http://www.example2.com",
  3507. "protocol": "http:",
  3508. "username": "",
  3509. "password": "",
  3510. "host": "www.example2.com",
  3511. "hostname": "www.example2.com",
  3512. "port": "",
  3513. "pathname": "/",
  3514. "search": "",
  3515. "hash": ""
  3516. },
  3517. {
  3518. "input": "file:...",
  3519. "base": "http://www.example.com/test",
  3520. "href": "file:///...",
  3521. "protocol": "file:",
  3522. "username": "",
  3523. "password": "",
  3524. "host": "",
  3525. "hostname": "",
  3526. "port": "",
  3527. "pathname": "/...",
  3528. "search": "",
  3529. "hash": ""
  3530. },
  3531. {
  3532. "input": "file:..",
  3533. "base": "http://www.example.com/test",
  3534. "href": "file:///",
  3535. "protocol": "file:",
  3536. "username": "",
  3537. "password": "",
  3538. "host": "",
  3539. "hostname": "",
  3540. "port": "",
  3541. "pathname": "/",
  3542. "search": "",
  3543. "hash": ""
  3544. },
  3545. {
  3546. "input": "file:a",
  3547. "base": "http://www.example.com/test",
  3548. "href": "file:///a",
  3549. "protocol": "file:",
  3550. "username": "",
  3551. "password": "",
  3552. "host": "",
  3553. "hostname": "",
  3554. "port": "",
  3555. "pathname": "/a",
  3556. "search": "",
  3557. "hash": ""
  3558. },
  3559. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
  3560. "Basic canonicalization, uppercase should be converted to lowercase",
  3561. {
  3562. "input": "http://ExAmPlE.CoM",
  3563. "base": "http://other.com/",
  3564. "href": "http://example.com/",
  3565. "origin": "http://example.com",
  3566. "protocol": "http:",
  3567. "username": "",
  3568. "password": "",
  3569. "host": "example.com",
  3570. "hostname": "example.com",
  3571. "port": "",
  3572. "pathname": "/",
  3573. "search": "",
  3574. "hash": ""
  3575. },
  3576. {
  3577. "input": "http://example example.com",
  3578. "base": "http://other.com/",
  3579. "failure": true
  3580. },
  3581. {
  3582. "input": "http://Goo%20 goo%7C|.com",
  3583. "base": "http://other.com/",
  3584. "failure": true
  3585. },
  3586. {
  3587. "input": "http://[]",
  3588. "base": "http://other.com/",
  3589. "failure": true
  3590. },
  3591. {
  3592. "input": "http://[:]",
  3593. "base": "http://other.com/",
  3594. "failure": true
  3595. },
  3596. "U+3000 is mapped to U+0020 (space) which is disallowed",
  3597. {
  3598. "input": "http://GOO\u00a0\u3000goo.com",
  3599. "base": "http://other.com/",
  3600. "failure": true
  3601. },
  3602. "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",
  3603. {
  3604. "input": "http://GOO\u200b\u2060\ufeffgoo.com",
  3605. "base": "http://other.com/",
  3606. "href": "http://googoo.com/",
  3607. "origin": "http://googoo.com",
  3608. "protocol": "http:",
  3609. "username": "",
  3610. "password": "",
  3611. "host": "googoo.com",
  3612. "hostname": "googoo.com",
  3613. "port": "",
  3614. "pathname": "/",
  3615. "search": "",
  3616. "hash": ""
  3617. },
  3618. "Leading and trailing C0 control or space",
  3619. {
  3620. "input": "\u0000\u001b\u0004\u0012 http://example.com/\u001f \u000d ",
  3621. "base": "about:blank",
  3622. "href": "http://example.com/",
  3623. "origin": "http://example.com",
  3624. "protocol": "http:",
  3625. "username": "",
  3626. "password": "",
  3627. "host": "example.com",
  3628. "hostname": "example.com",
  3629. "port": "",
  3630. "pathname": "/",
  3631. "search": "",
  3632. "hash": ""
  3633. },
  3634. "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
  3635. {
  3636. "input": "http://www.foo。bar.com",
  3637. "base": "http://other.com/",
  3638. "href": "http://www.foo.bar.com/",
  3639. "origin": "http://www.foo.bar.com",
  3640. "protocol": "http:",
  3641. "username": "",
  3642. "password": "",
  3643. "host": "www.foo.bar.com",
  3644. "hostname": "www.foo.bar.com",
  3645. "port": "",
  3646. "pathname": "/",
  3647. "search": "",
  3648. "hash": ""
  3649. },
  3650. "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0",
  3651. {
  3652. "input": "http://\ufdd0zyx.com",
  3653. "base": "http://other.com/",
  3654. "failure": true
  3655. },
  3656. "This is the same as previous but escaped",
  3657. {
  3658. "input": "http://%ef%b7%90zyx.com",
  3659. "base": "http://other.com/",
  3660. "failure": true
  3661. },
  3662. "U+FFFD",
  3663. {
  3664. "input": "https://\ufffd",
  3665. "base": "about:blank",
  3666. "failure": true
  3667. },
  3668. {
  3669. "input": "https://%EF%BF%BD",
  3670. "base": "about:blank",
  3671. "failure": true
  3672. },
  3673. {
  3674. "input": "https://x/\ufffd?\ufffd#\ufffd",
  3675. "base": "about:blank",
  3676. "href": "https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD",
  3677. "origin": "https://x",
  3678. "protocol": "https:",
  3679. "username": "",
  3680. "password": "",
  3681. "host": "x",
  3682. "hostname": "x",
  3683. "port": "",
  3684. "pathname": "/%EF%BF%BD",
  3685. "search": "?%EF%BF%BD",
  3686. "hash": "#%EF%BF%BD"
  3687. },
  3688. "Domain is ASCII, but a label is invalid IDNA",
  3689. {
  3690. "input": "http://a.b.c.xn--pokxncvks",
  3691. "base": "about:blank",
  3692. "failure": true
  3693. },
  3694. {
  3695. "input": "http://10.0.0.xn--pokxncvks",
  3696. "base": "about:blank",
  3697. "failure": true
  3698. },
  3699. "IDNA labels should be matched case-insensitively",
  3700. {
  3701. "input": "http://a.b.c.XN--pokxncvks",
  3702. "base": "about:blank",
  3703. "failure": true
  3704. },
  3705. {
  3706. "input": "http://a.b.c.Xn--pokxncvks",
  3707. "base": "about:blank",
  3708. "failure": true
  3709. },
  3710. {
  3711. "input": "http://10.0.0.XN--pokxncvks",
  3712. "base": "about:blank",
  3713. "failure": true
  3714. },
  3715. {
  3716. "input": "http://10.0.0.xN--pokxncvks",
  3717. "base": "about:blank",
  3718. "failure": true
  3719. },
  3720. "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.",
  3721. {
  3722. "input": "http://Go.com",
  3723. "base": "http://other.com/",
  3724. "href": "http://go.com/",
  3725. "origin": "http://go.com",
  3726. "protocol": "http:",
  3727. "username": "",
  3728. "password": "",
  3729. "host": "go.com",
  3730. "hostname": "go.com",
  3731. "port": "",
  3732. "pathname": "/",
  3733. "search": "",
  3734. "hash": ""
  3735. },
  3736. "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257",
  3737. {
  3738. "input": "http://%41.com",
  3739. "base": "http://other.com/",
  3740. "failure": true
  3741. },
  3742. {
  3743. "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com",
  3744. "base": "http://other.com/",
  3745. "failure": true
  3746. },
  3747. "...%00 in fullwidth should fail (also as escaped UTF-8 input)",
  3748. {
  3749. "input": "http://%00.com",
  3750. "base": "http://other.com/",
  3751. "failure": true
  3752. },
  3753. {
  3754. "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com",
  3755. "base": "http://other.com/",
  3756. "failure": true
  3757. },
  3758. "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
  3759. {
  3760. "input": "http://你好你好",
  3761. "base": "http://other.com/",
  3762. "href": "http://xn--6qqa088eba/",
  3763. "origin": "http://xn--6qqa088eba",
  3764. "protocol": "http:",
  3765. "username": "",
  3766. "password": "",
  3767. "host": "xn--6qqa088eba",
  3768. "hostname": "xn--6qqa088eba",
  3769. "port": "",
  3770. "pathname": "/",
  3771. "search": "",
  3772. "hash": ""
  3773. },
  3774. {
  3775. "input": "https://faß.ExAmPlE/",
  3776. "base": "about:blank",
  3777. "href": "https://xn--fa-hia.example/",
  3778. "origin": "https://xn--fa-hia.example",
  3779. "protocol": "https:",
  3780. "username": "",
  3781. "password": "",
  3782. "host": "xn--fa-hia.example",
  3783. "hostname": "xn--fa-hia.example",
  3784. "port": "",
  3785. "pathname": "/",
  3786. "search": "",
  3787. "hash": ""
  3788. },
  3789. {
  3790. "input": "sc://faß.ExAmPlE/",
  3791. "base": "about:blank",
  3792. "href": "sc://fa%C3%9F.ExAmPlE/",
  3793. "origin": "null",
  3794. "protocol": "sc:",
  3795. "username": "",
  3796. "password": "",
  3797. "host": "fa%C3%9F.ExAmPlE",
  3798. "hostname": "fa%C3%9F.ExAmPlE",
  3799. "port": "",
  3800. "pathname": "/",
  3801. "search": "",
  3802. "hash": ""
  3803. },
  3804. "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191",
  3805. {
  3806. "input": "http://%zz%66%a.com",
  3807. "base": "http://other.com/",
  3808. "failure": true
  3809. },
  3810. "If we get an invalid character that has been escaped.",
  3811. {
  3812. "input": "http://%25",
  3813. "base": "http://other.com/",
  3814. "failure": true
  3815. },
  3816. {
  3817. "input": "http://hello%00",
  3818. "base": "http://other.com/",
  3819. "failure": true
  3820. },
  3821. "Escaped numbers should be treated like IP addresses if they are.",
  3822. {
  3823. "input": "http://%30%78%63%30%2e%30%32%35%30.01",
  3824. "base": "http://other.com/",
  3825. "href": "http://192.168.0.1/",
  3826. "origin": "http://192.168.0.1",
  3827. "protocol": "http:",
  3828. "username": "",
  3829. "password": "",
  3830. "host": "192.168.0.1",
  3831. "hostname": "192.168.0.1",
  3832. "port": "",
  3833. "pathname": "/",
  3834. "search": "",
  3835. "hash": ""
  3836. },
  3837. {
  3838. "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e",
  3839. "base": "http://other.com/",
  3840. "href": "http://192.168.0.1/",
  3841. "origin": "http://192.168.0.1",
  3842. "protocol": "http:",
  3843. "username": "",
  3844. "password": "",
  3845. "host": "192.168.0.1",
  3846. "hostname": "192.168.0.1",
  3847. "port": "",
  3848. "pathname": "/",
  3849. "search": "",
  3850. "hash": ""
  3851. },
  3852. {
  3853. "input": "http://192.168.0.257",
  3854. "base": "http://other.com/",
  3855. "failure": true
  3856. },
  3857. "Invalid escaping in hosts causes failure",
  3858. {
  3859. "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01",
  3860. "base": "http://other.com/",
  3861. "failure": true
  3862. },
  3863. "A space in a host causes failure",
  3864. {
  3865. "input": "http://192.168.0.1 hello",
  3866. "base": "http://other.com/",
  3867. "failure": true
  3868. },
  3869. {
  3870. "input": "https://x x:12",
  3871. "base": "about:blank",
  3872. "failure": true
  3873. },
  3874. "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
  3875. {
  3876. "input": "http://0Xc0.0250.01",
  3877. "base": "http://other.com/",
  3878. "href": "http://192.168.0.1/",
  3879. "origin": "http://192.168.0.1",
  3880. "protocol": "http:",
  3881. "username": "",
  3882. "password": "",
  3883. "host": "192.168.0.1",
  3884. "hostname": "192.168.0.1",
  3885. "port": "",
  3886. "pathname": "/",
  3887. "search": "",
  3888. "hash": ""
  3889. },
  3890. "Domains with empty labels",
  3891. {
  3892. "input": "http://./",
  3893. "base": "about:blank",
  3894. "href": "http://./",
  3895. "origin": "http://.",
  3896. "protocol": "http:",
  3897. "username": "",
  3898. "password": "",
  3899. "host": ".",
  3900. "hostname": ".",
  3901. "port": "",
  3902. "pathname": "/",
  3903. "search": "",
  3904. "hash": ""
  3905. },
  3906. {
  3907. "input": "http://../",
  3908. "base": "about:blank",
  3909. "href": "http://../",
  3910. "origin": "http://..",
  3911. "protocol": "http:",
  3912. "username": "",
  3913. "password": "",
  3914. "host": "..",
  3915. "hostname": "..",
  3916. "port": "",
  3917. "pathname": "/",
  3918. "search": "",
  3919. "hash": ""
  3920. },
  3921. "Broken IPv6",
  3922. {
  3923. "input": "http://[www.google.com]/",
  3924. "base": "about:blank",
  3925. "failure": true
  3926. },
  3927. {
  3928. "input": "http://[google.com]",
  3929. "base": "http://other.com/",
  3930. "failure": true
  3931. },
  3932. {
  3933. "input": "http://[::1.2.3.4x]",
  3934. "base": "http://other.com/",
  3935. "failure": true
  3936. },
  3937. {
  3938. "input": "http://[::1.2.3.]",
  3939. "base": "http://other.com/",
  3940. "failure": true
  3941. },
  3942. {
  3943. "input": "http://[::1.2.]",
  3944. "base": "http://other.com/",
  3945. "failure": true
  3946. },
  3947. {
  3948. "input": "http://[::1.]",
  3949. "base": "http://other.com/",
  3950. "failure": true
  3951. },
  3952. "Misc Unicode",
  3953. {
  3954. "input": "http://foo:💩@example.com/bar",
  3955. "base": "http://other.com/",
  3956. "href": "http://foo:%F0%9F%92%A9@example.com/bar",
  3957. "origin": "http://example.com",
  3958. "protocol": "http:",
  3959. "username": "foo",
  3960. "password": "%F0%9F%92%A9",
  3961. "host": "example.com",
  3962. "hostname": "example.com",
  3963. "port": "",
  3964. "pathname": "/bar",
  3965. "search": "",
  3966. "hash": ""
  3967. },
  3968. "# resolving a fragment against any scheme succeeds",
  3969. {
  3970. "input": "#",
  3971. "base": "test:test",
  3972. "href": "test:test#",
  3973. "origin": "null",
  3974. "protocol": "test:",
  3975. "username": "",
  3976. "password": "",
  3977. "host": "",
  3978. "hostname": "",
  3979. "port": "",
  3980. "pathname": "test",
  3981. "search": "",
  3982. "hash": ""
  3983. },
  3984. {
  3985. "input": "#x",
  3986. "base": "mailto:x@x.com",
  3987. "href": "mailto:x@x.com#x",
  3988. "origin": "null",
  3989. "protocol": "mailto:",
  3990. "username": "",
  3991. "password": "",
  3992. "host": "",
  3993. "hostname": "",
  3994. "port": "",
  3995. "pathname": "x@x.com",
  3996. "search": "",
  3997. "hash": "#x"
  3998. },
  3999. {
  4000. "input": "#x",
  4001. "base": "data:,",
  4002. "href": "data:,#x",
  4003. "origin": "null",
  4004. "protocol": "data:",
  4005. "username": "",
  4006. "password": "",
  4007. "host": "",
  4008. "hostname": "",
  4009. "port": "",
  4010. "pathname": ",",
  4011. "search": "",
  4012. "hash": "#x"
  4013. },
  4014. {
  4015. "input": "#x",
  4016. "base": "about:blank",
  4017. "href": "about:blank#x",
  4018. "origin": "null",
  4019. "protocol": "about:",
  4020. "username": "",
  4021. "password": "",
  4022. "host": "",
  4023. "hostname": "",
  4024. "port": "",
  4025. "pathname": "blank",
  4026. "search": "",
  4027. "hash": "#x"
  4028. },
  4029. {
  4030. "input": "#",
  4031. "base": "test:test?test",
  4032. "href": "test:test?test#",
  4033. "origin": "null",
  4034. "protocol": "test:",
  4035. "username": "",
  4036. "password": "",
  4037. "host": "",
  4038. "hostname": "",
  4039. "port": "",
  4040. "pathname": "test",
  4041. "search": "?test",
  4042. "hash": ""
  4043. },
  4044. "# multiple @ in authority state",
  4045. {
  4046. "input": "https://@test@test@example:800/",
  4047. "base": "http://doesnotmatter/",
  4048. "href": "https://%40test%40test@example:800/",
  4049. "origin": "https://example:800",
  4050. "protocol": "https:",
  4051. "username": "%40test%40test",
  4052. "password": "",
  4053. "host": "example:800",
  4054. "hostname": "example",
  4055. "port": "800",
  4056. "pathname": "/",
  4057. "search": "",
  4058. "hash": ""
  4059. },
  4060. {
  4061. "input": "https://@@@example",
  4062. "base": "http://doesnotmatter/",
  4063. "href": "https://%40%40@example/",
  4064. "origin": "https://example",
  4065. "protocol": "https:",
  4066. "username": "%40%40",
  4067. "password": "",
  4068. "host": "example",
  4069. "hostname": "example",
  4070. "port": "",
  4071. "pathname": "/",
  4072. "search": "",
  4073. "hash": ""
  4074. },
  4075. "non-az-09 characters",
  4076. {
  4077. "input": "http://`{}:`{}@h/`{}?`{}",
  4078. "base": "http://doesnotmatter/",
  4079. "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}",
  4080. "origin": "http://h",
  4081. "protocol": "http:",
  4082. "username": "%60%7B%7D",
  4083. "password": "%60%7B%7D",
  4084. "host": "h",
  4085. "hostname": "h",
  4086. "port": "",
  4087. "pathname": "/%60%7B%7D",
  4088. "search": "?`{}",
  4089. "hash": ""
  4090. },
  4091. "byte is ' and url is special",
  4092. {
  4093. "input": "http://host/?'",
  4094. "base": "about:blank",
  4095. "href": "http://host/?%27",
  4096. "origin": "http://host",
  4097. "protocol": "http:",
  4098. "username": "",
  4099. "password": "",
  4100. "host": "host",
  4101. "hostname": "host",
  4102. "port": "",
  4103. "pathname": "/",
  4104. "search": "?%27",
  4105. "hash": ""
  4106. },
  4107. {
  4108. "input": "notspecial://host/?'",
  4109. "base": "about:blank",
  4110. "href": "notspecial://host/?'",
  4111. "origin": "null",
  4112. "protocol": "notspecial:",
  4113. "username": "",
  4114. "password": "",
  4115. "host": "host",
  4116. "hostname": "host",
  4117. "port": "",
  4118. "pathname": "/",
  4119. "search": "?'",
  4120. "hash": ""
  4121. },
  4122. "# Credentials in base",
  4123. {
  4124. "input": "/some/path",
  4125. "base": "http://user@example.org/smth",
  4126. "href": "http://user@example.org/some/path",
  4127. "origin": "http://example.org",
  4128. "protocol": "http:",
  4129. "username": "user",
  4130. "password": "",
  4131. "host": "example.org",
  4132. "hostname": "example.org",
  4133. "port": "",
  4134. "pathname": "/some/path",
  4135. "search": "",
  4136. "hash": ""
  4137. },
  4138. {
  4139. "input": "",
  4140. "base": "http://user:pass@example.org:21/smth",
  4141. "href": "http://user:pass@example.org:21/smth",
  4142. "origin": "http://example.org:21",
  4143. "protocol": "http:",
  4144. "username": "user",
  4145. "password": "pass",
  4146. "host": "example.org:21",
  4147. "hostname": "example.org",
  4148. "port": "21",
  4149. "pathname": "/smth",
  4150. "search": "",
  4151. "hash": ""
  4152. },
  4153. {
  4154. "input": "/some/path",
  4155. "base": "http://user:pass@example.org:21/smth",
  4156. "href": "http://user:pass@example.org:21/some/path",
  4157. "origin": "http://example.org:21",
  4158. "protocol": "http:",
  4159. "username": "user",
  4160. "password": "pass",
  4161. "host": "example.org:21",
  4162. "hostname": "example.org",
  4163. "port": "21",
  4164. "pathname": "/some/path",
  4165. "search": "",
  4166. "hash": ""
  4167. },
  4168. "# a set of tests designed by zcorpan for relative URLs with unknown schemes",
  4169. {
  4170. "input": "i",
  4171. "base": "sc:sd",
  4172. "failure": true
  4173. },
  4174. {
  4175. "input": "i",
  4176. "base": "sc:sd/sd",
  4177. "failure": true
  4178. },
  4179. {
  4180. "input": "i",
  4181. "base": "sc:/pa/pa",
  4182. "href": "sc:/pa/i",
  4183. "origin": "null",
  4184. "protocol": "sc:",
  4185. "username": "",
  4186. "password": "",
  4187. "host": "",
  4188. "hostname": "",
  4189. "port": "",
  4190. "pathname": "/pa/i",
  4191. "search": "",
  4192. "hash": ""
  4193. },
  4194. {
  4195. "input": "i",
  4196. "base": "sc://ho/pa",
  4197. "href": "sc://ho/i",
  4198. "origin": "null",
  4199. "protocol": "sc:",
  4200. "username": "",
  4201. "password": "",
  4202. "host": "ho",
  4203. "hostname": "ho",
  4204. "port": "",
  4205. "pathname": "/i",
  4206. "search": "",
  4207. "hash": ""
  4208. },
  4209. {
  4210. "input": "i",
  4211. "base": "sc:///pa/pa",
  4212. "href": "sc:///pa/i",
  4213. "origin": "null",
  4214. "protocol": "sc:",
  4215. "username": "",
  4216. "password": "",
  4217. "host": "",
  4218. "hostname": "",
  4219. "port": "",
  4220. "pathname": "/pa/i",
  4221. "search": "",
  4222. "hash": ""
  4223. },
  4224. {
  4225. "input": "../i",
  4226. "base": "sc:sd",
  4227. "failure": true
  4228. },
  4229. {
  4230. "input": "../i",
  4231. "base": "sc:sd/sd",
  4232. "failure": true
  4233. },
  4234. {
  4235. "input": "../i",
  4236. "base": "sc:/pa/pa",
  4237. "href": "sc:/i",
  4238. "origin": "null",
  4239. "protocol": "sc:",
  4240. "username": "",
  4241. "password": "",
  4242. "host": "",
  4243. "hostname": "",
  4244. "port": "",
  4245. "pathname": "/i",
  4246. "search": "",
  4247. "hash": ""
  4248. },
  4249. {
  4250. "input": "../i",
  4251. "base": "sc://ho/pa",
  4252. "href": "sc://ho/i",
  4253. "origin": "null",
  4254. "protocol": "sc:",
  4255. "username": "",
  4256. "password": "",
  4257. "host": "ho",
  4258. "hostname": "ho",
  4259. "port": "",
  4260. "pathname": "/i",
  4261. "search": "",
  4262. "hash": ""
  4263. },
  4264. {
  4265. "input": "../i",
  4266. "base": "sc:///pa/pa",
  4267. "href": "sc:///i",
  4268. "origin": "null",
  4269. "protocol": "sc:",
  4270. "username": "",
  4271. "password": "",
  4272. "host": "",
  4273. "hostname": "",
  4274. "port": "",
  4275. "pathname": "/i",
  4276. "search": "",
  4277. "hash": ""
  4278. },
  4279. {
  4280. "input": "/i",
  4281. "base": "sc:sd",
  4282. "failure": true
  4283. },
  4284. {
  4285. "input": "/i",
  4286. "base": "sc:sd/sd",
  4287. "failure": true
  4288. },
  4289. {
  4290. "input": "/i",
  4291. "base": "sc:/pa/pa",
  4292. "href": "sc:/i",
  4293. "origin": "null",
  4294. "protocol": "sc:",
  4295. "username": "",
  4296. "password": "",
  4297. "host": "",
  4298. "hostname": "",
  4299. "port": "",
  4300. "pathname": "/i",
  4301. "search": "",
  4302. "hash": ""
  4303. },
  4304. {
  4305. "input": "/i",
  4306. "base": "sc://ho/pa",
  4307. "href": "sc://ho/i",
  4308. "origin": "null",
  4309. "protocol": "sc:",
  4310. "username": "",
  4311. "password": "",
  4312. "host": "ho",
  4313. "hostname": "ho",
  4314. "port": "",
  4315. "pathname": "/i",
  4316. "search": "",
  4317. "hash": ""
  4318. },
  4319. {
  4320. "input": "/i",
  4321. "base": "sc:///pa/pa",
  4322. "href": "sc:///i",
  4323. "origin": "null",
  4324. "protocol": "sc:",
  4325. "username": "",
  4326. "password": "",
  4327. "host": "",
  4328. "hostname": "",
  4329. "port": "",
  4330. "pathname": "/i",
  4331. "search": "",
  4332. "hash": ""
  4333. },
  4334. {
  4335. "input": "?i",
  4336. "base": "sc:sd",
  4337. "failure": true
  4338. },
  4339. {
  4340. "input": "?i",
  4341. "base": "sc:sd/sd",
  4342. "failure": true
  4343. },
  4344. {
  4345. "input": "?i",
  4346. "base": "sc:/pa/pa",
  4347. "href": "sc:/pa/pa?i",
  4348. "origin": "null",
  4349. "protocol": "sc:",
  4350. "username": "",
  4351. "password": "",
  4352. "host": "",
  4353. "hostname": "",
  4354. "port": "",
  4355. "pathname": "/pa/pa",
  4356. "search": "?i",
  4357. "hash": ""
  4358. },
  4359. {
  4360. "input": "?i",
  4361. "base": "sc://ho/pa",
  4362. "href": "sc://ho/pa?i",
  4363. "origin": "null",
  4364. "protocol": "sc:",
  4365. "username": "",
  4366. "password": "",
  4367. "host": "ho",
  4368. "hostname": "ho",
  4369. "port": "",
  4370. "pathname": "/pa",
  4371. "search": "?i",
  4372. "hash": ""
  4373. },
  4374. {
  4375. "input": "?i",
  4376. "base": "sc:///pa/pa",
  4377. "href": "sc:///pa/pa?i",
  4378. "origin": "null",
  4379. "protocol": "sc:",
  4380. "username": "",
  4381. "password": "",
  4382. "host": "",
  4383. "hostname": "",
  4384. "port": "",
  4385. "pathname": "/pa/pa",
  4386. "search": "?i",
  4387. "hash": ""
  4388. },
  4389. {
  4390. "input": "#i",
  4391. "base": "sc:sd",
  4392. "href": "sc:sd#i",
  4393. "origin": "null",
  4394. "protocol": "sc:",
  4395. "username": "",
  4396. "password": "",
  4397. "host": "",
  4398. "hostname": "",
  4399. "port": "",
  4400. "pathname": "sd",
  4401. "search": "",
  4402. "hash": "#i"
  4403. },
  4404. {
  4405. "input": "#i",
  4406. "base": "sc:sd/sd",
  4407. "href": "sc:sd/sd#i",
  4408. "origin": "null",
  4409. "protocol": "sc:",
  4410. "username": "",
  4411. "password": "",
  4412. "host": "",
  4413. "hostname": "",
  4414. "port": "",
  4415. "pathname": "sd/sd",
  4416. "search": "",
  4417. "hash": "#i"
  4418. },
  4419. {
  4420. "input": "#i",
  4421. "base": "sc:/pa/pa",
  4422. "href": "sc:/pa/pa#i",
  4423. "origin": "null",
  4424. "protocol": "sc:",
  4425. "username": "",
  4426. "password": "",
  4427. "host": "",
  4428. "hostname": "",
  4429. "port": "",
  4430. "pathname": "/pa/pa",
  4431. "search": "",
  4432. "hash": "#i"
  4433. },
  4434. {
  4435. "input": "#i",
  4436. "base": "sc://ho/pa",
  4437. "href": "sc://ho/pa#i",
  4438. "origin": "null",
  4439. "protocol": "sc:",
  4440. "username": "",
  4441. "password": "",
  4442. "host": "ho",
  4443. "hostname": "ho",
  4444. "port": "",
  4445. "pathname": "/pa",
  4446. "search": "",
  4447. "hash": "#i"
  4448. },
  4449. {
  4450. "input": "#i",
  4451. "base": "sc:///pa/pa",
  4452. "href": "sc:///pa/pa#i",
  4453. "origin": "null",
  4454. "protocol": "sc:",
  4455. "username": "",
  4456. "password": "",
  4457. "host": "",
  4458. "hostname": "",
  4459. "port": "",
  4460. "pathname": "/pa/pa",
  4461. "search": "",
  4462. "hash": "#i"
  4463. },
  4464. "# make sure that relative URL logic works on known typically non-relative schemes too",
  4465. {
  4466. "input": "about:/../",
  4467. "base": "about:blank",
  4468. "href": "about:/",
  4469. "origin": "null",
  4470. "protocol": "about:",
  4471. "username": "",
  4472. "password": "",
  4473. "host": "",
  4474. "hostname": "",
  4475. "port": "",
  4476. "pathname": "/",
  4477. "search": "",
  4478. "hash": ""
  4479. },
  4480. {
  4481. "input": "data:/../",
  4482. "base": "about:blank",
  4483. "href": "data:/",
  4484. "origin": "null",
  4485. "protocol": "data:",
  4486. "username": "",
  4487. "password": "",
  4488. "host": "",
  4489. "hostname": "",
  4490. "port": "",
  4491. "pathname": "/",
  4492. "search": "",
  4493. "hash": ""
  4494. },
  4495. {
  4496. "input": "javascript:/../",
  4497. "base": "about:blank",
  4498. "href": "javascript:/",
  4499. "origin": "null",
  4500. "protocol": "javascript:",
  4501. "username": "",
  4502. "password": "",
  4503. "host": "",
  4504. "hostname": "",
  4505. "port": "",
  4506. "pathname": "/",
  4507. "search": "",
  4508. "hash": ""
  4509. },
  4510. {
  4511. "input": "mailto:/../",
  4512. "base": "about:blank",
  4513. "href": "mailto:/",
  4514. "origin": "null",
  4515. "protocol": "mailto:",
  4516. "username": "",
  4517. "password": "",
  4518. "host": "",
  4519. "hostname": "",
  4520. "port": "",
  4521. "pathname": "/",
  4522. "search": "",
  4523. "hash": ""
  4524. },
  4525. "# unknown schemes and their hosts",
  4526. {
  4527. "input": "sc://ñ.test/",
  4528. "base": "about:blank",
  4529. "href": "sc://%C3%B1.test/",
  4530. "origin": "null",
  4531. "protocol": "sc:",
  4532. "username": "",
  4533. "password": "",
  4534. "host": "%C3%B1.test",
  4535. "hostname": "%C3%B1.test",
  4536. "port": "",
  4537. "pathname": "/",
  4538. "search": "",
  4539. "hash": ""
  4540. },
  4541. {
  4542. "input": "sc://%/",
  4543. "base": "about:blank",
  4544. "href": "sc://%/",
  4545. "protocol": "sc:",
  4546. "username": "",
  4547. "password": "",
  4548. "host": "%",
  4549. "hostname": "%",
  4550. "port": "",
  4551. "pathname": "/",
  4552. "search": "",
  4553. "hash": ""
  4554. },
  4555. {
  4556. "input": "sc://@/",
  4557. "base": "about:blank",
  4558. "failure": true
  4559. },
  4560. {
  4561. "input": "sc://te@s:t@/",
  4562. "base": "about:blank",
  4563. "failure": true
  4564. },
  4565. {
  4566. "input": "sc://:/",
  4567. "base": "about:blank",
  4568. "failure": true
  4569. },
  4570. {
  4571. "input": "sc://:12/",
  4572. "base": "about:blank",
  4573. "failure": true
  4574. },
  4575. {
  4576. "input": "x",
  4577. "base": "sc://ñ",
  4578. "href": "sc://%C3%B1/x",
  4579. "origin": "null",
  4580. "protocol": "sc:",
  4581. "username": "",
  4582. "password": "",
  4583. "host": "%C3%B1",
  4584. "hostname": "%C3%B1",
  4585. "port": "",
  4586. "pathname": "/x",
  4587. "search": "",
  4588. "hash": ""
  4589. },
  4590. "# unknown schemes and backslashes",
  4591. {
  4592. "input": "sc:\\../",
  4593. "base": "about:blank",
  4594. "href": "sc:\\../",
  4595. "origin": "null",
  4596. "protocol": "sc:",
  4597. "username": "",
  4598. "password": "",
  4599. "host": "",
  4600. "hostname": "",
  4601. "port": "",
  4602. "pathname": "\\../",
  4603. "search": "",
  4604. "hash": ""
  4605. },
  4606. "# unknown scheme with path looking like a password",
  4607. {
  4608. "input": "sc::a@example.net",
  4609. "base": "about:blank",
  4610. "href": "sc::a@example.net",
  4611. "origin": "null",
  4612. "protocol": "sc:",
  4613. "username": "",
  4614. "password": "",
  4615. "host": "",
  4616. "hostname": "",
  4617. "port": "",
  4618. "pathname": ":a@example.net",
  4619. "search": "",
  4620. "hash": ""
  4621. },
  4622. "# unknown scheme with bogus percent-encoding",
  4623. {
  4624. "input": "wow:%NBD",
  4625. "base": "about:blank",
  4626. "href": "wow:%NBD",
  4627. "origin": "null",
  4628. "protocol": "wow:",
  4629. "username": "",
  4630. "password": "",
  4631. "host": "",
  4632. "hostname": "",
  4633. "port": "",
  4634. "pathname": "%NBD",
  4635. "search": "",
  4636. "hash": ""
  4637. },
  4638. {
  4639. "input": "wow:%1G",
  4640. "base": "about:blank",
  4641. "href": "wow:%1G",
  4642. "origin": "null",
  4643. "protocol": "wow:",
  4644. "username": "",
  4645. "password": "",
  4646. "host": "",
  4647. "hostname": "",
  4648. "port": "",
  4649. "pathname": "%1G",
  4650. "search": "",
  4651. "hash": ""
  4652. },
  4653. "# unknown scheme with non-URL characters",
  4654. {
  4655. "input": "wow:\uFFFF",
  4656. "base": "about:blank",
  4657. "href": "wow:%EF%BF%BF",
  4658. "origin": "null",
  4659. "protocol": "wow:",
  4660. "username": "",
  4661. "password": "",
  4662. "host": "",
  4663. "hostname": "",
  4664. "port": "",
  4665. "pathname": "%EF%BF%BF",
  4666. "search": "",
  4667. "hash": ""
  4668. },
  4669. "Forbidden host code points",
  4670. {
  4671. "input": "sc://a\u0000b/",
  4672. "base": "about:blank",
  4673. "failure": true
  4674. },
  4675. {
  4676. "input": "sc://a b/",
  4677. "base": "about:blank",
  4678. "failure": true
  4679. },
  4680. {
  4681. "input": "sc://a<b",
  4682. "base": "about:blank",
  4683. "failure": true
  4684. },
  4685. {
  4686. "input": "sc://a>b",
  4687. "base": "about:blank",
  4688. "failure": true
  4689. },
  4690. {
  4691. "input": "sc://a[b/",
  4692. "base": "about:blank",
  4693. "failure": true
  4694. },
  4695. {
  4696. "input": "sc://a\\b/",
  4697. "base": "about:blank",
  4698. "failure": true
  4699. },
  4700. {
  4701. "input": "sc://a]b/",
  4702. "base": "about:blank",
  4703. "failure": true
  4704. },
  4705. {
  4706. "input": "sc://a^b",
  4707. "base": "about:blank",
  4708. "failure": true
  4709. },
  4710. "Forbidden host codepoints: tabs and newlines are removed during preprocessing",
  4711. {
  4712. "input": "foo://ho\u0009st/",
  4713. "base": "about:blank",
  4714. "hash": "",
  4715. "host": "host",
  4716. "hostname": "host",
  4717. "href":"foo://host/",
  4718. "password": "",
  4719. "pathname": "/",
  4720. "port":"",
  4721. "protocol": "foo:",
  4722. "search": "",
  4723. "username": ""
  4724. },
  4725. {
  4726. "input": "foo://ho\u000Ast/",
  4727. "base": "about:blank",
  4728. "hash": "",
  4729. "host": "host",
  4730. "hostname": "host",
  4731. "href":"foo://host/",
  4732. "password": "",
  4733. "pathname": "/",
  4734. "port":"",
  4735. "protocol": "foo:",
  4736. "search": "",
  4737. "username": ""
  4738. },
  4739. {
  4740. "input": "foo://ho\u000Dst/",
  4741. "base": "about:blank",
  4742. "hash": "",
  4743. "host": "host",
  4744. "hostname": "host",
  4745. "href":"foo://host/",
  4746. "password": "",
  4747. "pathname": "/",
  4748. "port":"",
  4749. "protocol": "foo:",
  4750. "search": "",
  4751. "username": ""
  4752. },
  4753. "Forbidden domain code-points",
  4754. {
  4755. "input": "http://a\u0000b/",
  4756. "base": "about:blank",
  4757. "failure": true
  4758. },
  4759. {
  4760. "input": "http://a\u0001b/",
  4761. "base": "about:blank",
  4762. "failure": true
  4763. },
  4764. {
  4765. "input": "http://a\u0002b/",
  4766. "base": "about:blank",
  4767. "failure": true
  4768. },
  4769. {
  4770. "input": "http://a\u0003b/",
  4771. "base": "about:blank",
  4772. "failure": true
  4773. },
  4774. {
  4775. "input": "http://a\u0004b/",
  4776. "base": "about:blank",
  4777. "failure": true
  4778. },
  4779. {
  4780. "input": "http://a\u0005b/",
  4781. "base": "about:blank",
  4782. "failure": true
  4783. },
  4784. {
  4785. "input": "http://a\u0006b/",
  4786. "base": "about:blank",
  4787. "failure": true
  4788. },
  4789. {
  4790. "input": "http://a\u0007b/",
  4791. "base": "about:blank",
  4792. "failure": true
  4793. },
  4794. {
  4795. "input": "http://a\u0008b/",
  4796. "base": "about:blank",
  4797. "failure": true
  4798. },
  4799. {
  4800. "input": "http://a\u000Bb/",
  4801. "base": "about:blank",
  4802. "failure": true
  4803. },
  4804. {
  4805. "input": "http://a\u000Cb/",
  4806. "base": "about:blank",
  4807. "failure": true
  4808. },
  4809. {
  4810. "input": "http://a\u000Eb/",
  4811. "base": "about:blank",
  4812. "failure": true
  4813. },
  4814. {
  4815. "input": "http://a\u000Fb/",
  4816. "base": "about:blank",
  4817. "failure": true
  4818. },
  4819. {
  4820. "input": "http://a\u0010b/",
  4821. "base": "about:blank",
  4822. "failure": true
  4823. },
  4824. {
  4825. "input": "http://a\u0011b/",
  4826. "base": "about:blank",
  4827. "failure": true
  4828. },
  4829. {
  4830. "input": "http://a\u0012b/",
  4831. "base": "about:blank",
  4832. "failure": true
  4833. },
  4834. {
  4835. "input": "http://a\u0013b/",
  4836. "base": "about:blank",
  4837. "failure": true
  4838. },
  4839. {
  4840. "input": "http://a\u0014b/",
  4841. "base": "about:blank",
  4842. "failure": true
  4843. },
  4844. {
  4845. "input": "http://a\u0015b/",
  4846. "base": "about:blank",
  4847. "failure": true
  4848. },
  4849. {
  4850. "input": "http://a\u0016b/",
  4851. "base": "about:blank",
  4852. "failure": true
  4853. },
  4854. {
  4855. "input": "http://a\u0017b/",
  4856. "base": "about:blank",
  4857. "failure": true
  4858. },
  4859. {
  4860. "input": "http://a\u0018b/",
  4861. "base": "about:blank",
  4862. "failure": true
  4863. },
  4864. {
  4865. "input": "http://a\u0019b/",
  4866. "base": "about:blank",
  4867. "failure": true
  4868. },
  4869. {
  4870. "input": "http://a\u001Ab/",
  4871. "base": "about:blank",
  4872. "failure": true
  4873. },
  4874. {
  4875. "input": "http://a\u001Bb/",
  4876. "base": "about:blank",
  4877. "failure": true
  4878. },
  4879. {
  4880. "input": "http://a\u001Cb/",
  4881. "base": "about:blank",
  4882. "failure": true
  4883. },
  4884. {
  4885. "input": "http://a\u001Db/",
  4886. "base": "about:blank",
  4887. "failure": true
  4888. },
  4889. {
  4890. "input": "http://a\u001Eb/",
  4891. "base": "about:blank",
  4892. "failure": true
  4893. },
  4894. {
  4895. "input": "http://a\u001Fb/",
  4896. "base": "about:blank",
  4897. "failure": true
  4898. },
  4899. {
  4900. "input": "http://a b/",
  4901. "base": "about:blank",
  4902. "failure": true
  4903. },
  4904. {
  4905. "input": "http://a%b/",
  4906. "base": "about:blank",
  4907. "failure": true
  4908. },
  4909. {
  4910. "input": "http://a<b",
  4911. "base": "about:blank",
  4912. "failure": true
  4913. },
  4914. {
  4915. "input": "http://a>b",
  4916. "base": "about:blank",
  4917. "failure": true
  4918. },
  4919. {
  4920. "input": "http://a[b/",
  4921. "base": "about:blank",
  4922. "failure": true
  4923. },
  4924. {
  4925. "input": "http://a]b/",
  4926. "base": "about:blank",
  4927. "failure": true
  4928. },
  4929. {
  4930. "input": "http://a^b",
  4931. "base": "about:blank",
  4932. "failure": true
  4933. },
  4934. {
  4935. "input": "http://a\u007Fb/",
  4936. "base": "about:blank",
  4937. "failure": true
  4938. },
  4939. "Forbidden domain codepoints: tabs and newlines are removed during preprocessing",
  4940. {
  4941. "input": "http://ho\u0009st/",
  4942. "base": "about:blank",
  4943. "hash": "",
  4944. "host": "host",
  4945. "hostname": "host",
  4946. "href":"http://host/",
  4947. "password": "",
  4948. "pathname": "/",
  4949. "port":"",
  4950. "protocol": "http:",
  4951. "search": "",
  4952. "username": ""
  4953. },
  4954. {
  4955. "input": "http://ho\u000Ast/",
  4956. "base": "about:blank",
  4957. "hash": "",
  4958. "host": "host",
  4959. "hostname": "host",
  4960. "href":"http://host/",
  4961. "password": "",
  4962. "pathname": "/",
  4963. "port":"",
  4964. "protocol": "http:",
  4965. "search": "",
  4966. "username": ""
  4967. },
  4968. {
  4969. "input": "http://ho\u000Dst/",
  4970. "base": "about:blank",
  4971. "hash": "",
  4972. "host": "host",
  4973. "hostname": "host",
  4974. "href":"http://host/",
  4975. "password": "",
  4976. "pathname": "/",
  4977. "port":"",
  4978. "protocol": "http:",
  4979. "search": "",
  4980. "username": ""
  4981. },
  4982. "Encoded forbidden domain codepoints in special URLs",
  4983. {
  4984. "input": "http://ho%00st/",
  4985. "base": "about:blank",
  4986. "failure": true
  4987. },
  4988. {
  4989. "input": "http://ho%01st/",
  4990. "base": "about:blank",
  4991. "failure": true
  4992. },
  4993. {
  4994. "input": "http://ho%02st/",
  4995. "base": "about:blank",
  4996. "failure": true
  4997. },
  4998. {
  4999. "input": "http://ho%03st/",
  5000. "base": "about:blank",
  5001. "failure": true
  5002. },
  5003. {
  5004. "input": "http://ho%04st/",
  5005. "base": "about:blank",
  5006. "failure": true
  5007. },
  5008. {
  5009. "input": "http://ho%05st/",
  5010. "base": "about:blank",
  5011. "failure": true
  5012. },
  5013. {
  5014. "input": "http://ho%06st/",
  5015. "base": "about:blank",
  5016. "failure": true
  5017. },
  5018. {
  5019. "input": "http://ho%07st/",
  5020. "base": "about:blank",
  5021. "failure": true
  5022. },
  5023. {
  5024. "input": "http://ho%08st/",
  5025. "base": "about:blank",
  5026. "failure": true
  5027. },
  5028. {
  5029. "input": "http://ho%09st/",
  5030. "base": "about:blank",
  5031. "failure": true
  5032. },
  5033. {
  5034. "input": "http://ho%0Ast/",
  5035. "base": "about:blank",
  5036. "failure": true
  5037. },
  5038. {
  5039. "input": "http://ho%0Bst/",
  5040. "base": "about:blank",
  5041. "failure": true
  5042. },
  5043. {
  5044. "input": "http://ho%0Cst/",
  5045. "base": "about:blank",
  5046. "failure": true
  5047. },
  5048. {
  5049. "input": "http://ho%0Dst/",
  5050. "base": "about:blank",
  5051. "failure": true
  5052. },
  5053. {
  5054. "input": "http://ho%0Est/",
  5055. "base": "about:blank",
  5056. "failure": true
  5057. },
  5058. {
  5059. "input": "http://ho%0Fst/",
  5060. "base": "about:blank",
  5061. "failure": true
  5062. },
  5063. {
  5064. "input": "http://ho%10st/",
  5065. "base": "about:blank",
  5066. "failure": true
  5067. },
  5068. {
  5069. "input": "http://ho%11st/",
  5070. "base": "about:blank",
  5071. "failure": true
  5072. },
  5073. {
  5074. "input": "http://ho%12st/",
  5075. "base": "about:blank",
  5076. "failure": true
  5077. },
  5078. {
  5079. "input": "http://ho%13st/",
  5080. "base": "about:blank",
  5081. "failure": true
  5082. },
  5083. {
  5084. "input": "http://ho%14st/",
  5085. "base": "about:blank",
  5086. "failure": true
  5087. },
  5088. {
  5089. "input": "http://ho%15st/",
  5090. "base": "about:blank",
  5091. "failure": true
  5092. },
  5093. {
  5094. "input": "http://ho%16st/",
  5095. "base": "about:blank",
  5096. "failure": true
  5097. },
  5098. {
  5099. "input": "http://ho%17st/",
  5100. "base": "about:blank",
  5101. "failure": true
  5102. },
  5103. {
  5104. "input": "http://ho%18st/",
  5105. "base": "about:blank",
  5106. "failure": true
  5107. },
  5108. {
  5109. "input": "http://ho%19st/",
  5110. "base": "about:blank",
  5111. "failure": true
  5112. },
  5113. {
  5114. "input": "http://ho%1Ast/",
  5115. "base": "about:blank",
  5116. "failure": true
  5117. },
  5118. {
  5119. "input": "http://ho%1Bst/",
  5120. "base": "about:blank",
  5121. "failure": true
  5122. },
  5123. {
  5124. "input": "http://ho%1Cst/",
  5125. "base": "about:blank",
  5126. "failure": true
  5127. },
  5128. {
  5129. "input": "http://ho%1Dst/",
  5130. "base": "about:blank",
  5131. "failure": true
  5132. },
  5133. {
  5134. "input": "http://ho%1Est/",
  5135. "base": "about:blank",
  5136. "failure": true
  5137. },
  5138. {
  5139. "input": "http://ho%1Fst/",
  5140. "base": "about:blank",
  5141. "failure": true
  5142. },
  5143. {
  5144. "input": "http://ho%20st/",
  5145. "base": "about:blank",
  5146. "failure": true
  5147. },
  5148. {
  5149. "input": "http://ho%23st/",
  5150. "base": "about:blank",
  5151. "failure": true
  5152. },
  5153. {
  5154. "input": "http://ho%25st/",
  5155. "base": "about:blank",
  5156. "failure": true
  5157. },
  5158. {
  5159. "input": "http://ho%2Fst/",
  5160. "base": "about:blank",
  5161. "failure": true
  5162. },
  5163. {
  5164. "input": "http://ho%3Ast/",
  5165. "base": "about:blank",
  5166. "failure": true
  5167. },
  5168. {
  5169. "input": "http://ho%3Cst/",
  5170. "base": "about:blank",
  5171. "failure": true
  5172. },
  5173. {
  5174. "input": "http://ho%3Est/",
  5175. "base": "about:blank",
  5176. "failure": true
  5177. },
  5178. {
  5179. "input": "http://ho%3Fst/",
  5180. "base": "about:blank",
  5181. "failure": true
  5182. },
  5183. {
  5184. "input": "http://ho%40st/",
  5185. "base": "about:blank",
  5186. "failure": true
  5187. },
  5188. {
  5189. "input": "http://ho%5Bst/",
  5190. "base": "about:blank",
  5191. "failure": true
  5192. },
  5193. {
  5194. "input": "http://ho%5Cst/",
  5195. "base": "about:blank",
  5196. "failure": true
  5197. },
  5198. {
  5199. "input": "http://ho%5Dst/",
  5200. "base": "about:blank",
  5201. "failure": true
  5202. },
  5203. {
  5204. "input": "http://ho%7Fst/",
  5205. "base": "about:blank",
  5206. "failure": true
  5207. },
  5208. "Allowed host/domain code points",
  5209. {
  5210. "input": "http://!\"$&'()*+,-.;=_`{}~/",
  5211. "base": "about:blank",
  5212. "href": "http://!\"$&'()*+,-.;=_`{}~/",
  5213. "origin": "http://!\"$&'()*+,-.;=_`{}~",
  5214. "protocol": "http:",
  5215. "username": "",
  5216. "password": "",
  5217. "host": "!\"$&'()*+,-.;=_`{}~",
  5218. "hostname": "!\"$&'()*+,-.;=_`{}~",
  5219. "port": "",
  5220. "pathname": "/",
  5221. "search": "",
  5222. "hash": ""
  5223. },
  5224. {
  5225. "input": "sc://\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u000B\u000C\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\u007F!\"$%&'()*+,-.;=_`{}~/",
  5226. "base": "about:blank",
  5227. "href": "sc://%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~/",
  5228. "origin": "null",
  5229. "protocol": "sc:",
  5230. "username": "",
  5231. "password": "",
  5232. "host": "%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~",
  5233. "hostname": "%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~",
  5234. "port": "",
  5235. "pathname": "/",
  5236. "search": "",
  5237. "hash": ""
  5238. },
  5239. "# Hosts and percent-encoding",
  5240. {
  5241. "input": "ftp://example.com%80/",
  5242. "base": "about:blank",
  5243. "failure": true
  5244. },
  5245. {
  5246. "input": "ftp://example.com%A0/",
  5247. "base": "about:blank",
  5248. "failure": true
  5249. },
  5250. {
  5251. "input": "https://example.com%80/",
  5252. "base": "about:blank",
  5253. "failure": true
  5254. },
  5255. {
  5256. "input": "https://example.com%A0/",
  5257. "base": "about:blank",
  5258. "failure": true
  5259. },
  5260. {
  5261. "input": "ftp://%e2%98%83",
  5262. "base": "about:blank",
  5263. "href": "ftp://xn--n3h/",
  5264. "origin": "ftp://xn--n3h",
  5265. "protocol": "ftp:",
  5266. "username": "",
  5267. "password": "",
  5268. "host": "xn--n3h",
  5269. "hostname": "xn--n3h",
  5270. "port": "",
  5271. "pathname": "/",
  5272. "search": "",
  5273. "hash": ""
  5274. },
  5275. {
  5276. "input": "https://%e2%98%83",
  5277. "base": "about:blank",
  5278. "href": "https://xn--n3h/",
  5279. "origin": "https://xn--n3h",
  5280. "protocol": "https:",
  5281. "username": "",
  5282. "password": "",
  5283. "host": "xn--n3h",
  5284. "hostname": "xn--n3h",
  5285. "port": "",
  5286. "pathname": "/",
  5287. "search": "",
  5288. "hash": ""
  5289. },
  5290. "# tests from jsdom/whatwg-url designed for code coverage",
  5291. {
  5292. "input": "http://127.0.0.1:10100/relative_import.html",
  5293. "base": "about:blank",
  5294. "href": "http://127.0.0.1:10100/relative_import.html",
  5295. "origin": "http://127.0.0.1:10100",
  5296. "protocol": "http:",
  5297. "username": "",
  5298. "password": "",
  5299. "host": "127.0.0.1:10100",
  5300. "hostname": "127.0.0.1",
  5301. "port": "10100",
  5302. "pathname": "/relative_import.html",
  5303. "search": "",
  5304. "hash": ""
  5305. },
  5306. {
  5307. "input": "http://facebook.com/?foo=%7B%22abc%22",
  5308. "base": "about:blank",
  5309. "href": "http://facebook.com/?foo=%7B%22abc%22",
  5310. "origin": "http://facebook.com",
  5311. "protocol": "http:",
  5312. "username": "",
  5313. "password": "",
  5314. "host": "facebook.com",
  5315. "hostname": "facebook.com",
  5316. "port": "",
  5317. "pathname": "/",
  5318. "search": "?foo=%7B%22abc%22",
  5319. "hash": ""
  5320. },
  5321. {
  5322. "input": "https://localhost:3000/jqueryui@1.2.3",
  5323. "base": "about:blank",
  5324. "href": "https://localhost:3000/jqueryui@1.2.3",
  5325. "origin": "https://localhost:3000",
  5326. "protocol": "https:",
  5327. "username": "",
  5328. "password": "",
  5329. "host": "localhost:3000",
  5330. "hostname": "localhost",
  5331. "port": "3000",
  5332. "pathname": "/jqueryui@1.2.3",
  5333. "search": "",
  5334. "hash": ""
  5335. },
  5336. "# tab/LF/CR",
  5337. {
  5338. "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",
  5339. "base": "about:blank",
  5340. "href": "http://host:9000/path?query#frag",
  5341. "origin": "http://host:9000",
  5342. "protocol": "http:",
  5343. "username": "",
  5344. "password": "",
  5345. "host": "host:9000",
  5346. "hostname": "host",
  5347. "port": "9000",
  5348. "pathname": "/path",
  5349. "search": "?query",
  5350. "hash": "#frag"
  5351. },
  5352. "# Stringification of URL.searchParams",
  5353. {
  5354. "input": "?a=b&c=d",
  5355. "base": "http://example.org/foo/bar",
  5356. "href": "http://example.org/foo/bar?a=b&c=d",
  5357. "origin": "http://example.org",
  5358. "protocol": "http:",
  5359. "username": "",
  5360. "password": "",
  5361. "host": "example.org",
  5362. "hostname": "example.org",
  5363. "port": "",
  5364. "pathname": "/foo/bar",
  5365. "search": "?a=b&c=d",
  5366. "searchParams": "a=b&c=d",
  5367. "hash": ""
  5368. },
  5369. {
  5370. "input": "??a=b&c=d",
  5371. "base": "http://example.org/foo/bar",
  5372. "href": "http://example.org/foo/bar??a=b&c=d",
  5373. "origin": "http://example.org",
  5374. "protocol": "http:",
  5375. "username": "",
  5376. "password": "",
  5377. "host": "example.org",
  5378. "hostname": "example.org",
  5379. "port": "",
  5380. "pathname": "/foo/bar",
  5381. "search": "??a=b&c=d",
  5382. "searchParams": "%3Fa=b&c=d",
  5383. "hash": ""
  5384. },
  5385. "# Scheme only",
  5386. {
  5387. "input": "http:",
  5388. "base": "http://example.org/foo/bar",
  5389. "href": "http://example.org/foo/bar",
  5390. "origin": "http://example.org",
  5391. "protocol": "http:",
  5392. "username": "",
  5393. "password": "",
  5394. "host": "example.org",
  5395. "hostname": "example.org",
  5396. "port": "",
  5397. "pathname": "/foo/bar",
  5398. "search": "",
  5399. "searchParams": "",
  5400. "hash": ""
  5401. },
  5402. {
  5403. "input": "http:",
  5404. "base": "https://example.org/foo/bar",
  5405. "failure": true
  5406. },
  5407. {
  5408. "input": "sc:",
  5409. "base": "https://example.org/foo/bar",
  5410. "href": "sc:",
  5411. "origin": "null",
  5412. "protocol": "sc:",
  5413. "username": "",
  5414. "password": "",
  5415. "host": "",
  5416. "hostname": "",
  5417. "port": "",
  5418. "pathname": "",
  5419. "search": "",
  5420. "searchParams": "",
  5421. "hash": ""
  5422. },
  5423. "# Percent encoding of fragments",
  5424. {
  5425. "input": "http://foo.bar/baz?qux#foo\bbar",
  5426. "base": "about:blank",
  5427. "href": "http://foo.bar/baz?qux#foo%08bar",
  5428. "origin": "http://foo.bar",
  5429. "protocol": "http:",
  5430. "username": "",
  5431. "password": "",
  5432. "host": "foo.bar",
  5433. "hostname": "foo.bar",
  5434. "port": "",
  5435. "pathname": "/baz",
  5436. "search": "?qux",
  5437. "searchParams": "qux=",
  5438. "hash": "#foo%08bar"
  5439. },
  5440. {
  5441. "input": "http://foo.bar/baz?qux#foo\"bar",
  5442. "base": "about:blank",
  5443. "href": "http://foo.bar/baz?qux#foo%22bar",
  5444. "origin": "http://foo.bar",
  5445. "protocol": "http:",
  5446. "username": "",
  5447. "password": "",
  5448. "host": "foo.bar",
  5449. "hostname": "foo.bar",
  5450. "port": "",
  5451. "pathname": "/baz",
  5452. "search": "?qux",
  5453. "searchParams": "qux=",
  5454. "hash": "#foo%22bar"
  5455. },
  5456. {
  5457. "input": "http://foo.bar/baz?qux#foo<bar",
  5458. "base": "about:blank",
  5459. "href": "http://foo.bar/baz?qux#foo%3Cbar",
  5460. "origin": "http://foo.bar",
  5461. "protocol": "http:",
  5462. "username": "",
  5463. "password": "",
  5464. "host": "foo.bar",
  5465. "hostname": "foo.bar",
  5466. "port": "",
  5467. "pathname": "/baz",
  5468. "search": "?qux",
  5469. "searchParams": "qux=",
  5470. "hash": "#foo%3Cbar"
  5471. },
  5472. {
  5473. "input": "http://foo.bar/baz?qux#foo>bar",
  5474. "base": "about:blank",
  5475. "href": "http://foo.bar/baz?qux#foo%3Ebar",
  5476. "origin": "http://foo.bar",
  5477. "protocol": "http:",
  5478. "username": "",
  5479. "password": "",
  5480. "host": "foo.bar",
  5481. "hostname": "foo.bar",
  5482. "port": "",
  5483. "pathname": "/baz",
  5484. "search": "?qux",
  5485. "searchParams": "qux=",
  5486. "hash": "#foo%3Ebar"
  5487. },
  5488. {
  5489. "input": "http://foo.bar/baz?qux#foo`bar",
  5490. "base": "about:blank",
  5491. "href": "http://foo.bar/baz?qux#foo%60bar",
  5492. "origin": "http://foo.bar",
  5493. "protocol": "http:",
  5494. "username": "",
  5495. "password": "",
  5496. "host": "foo.bar",
  5497. "hostname": "foo.bar",
  5498. "port": "",
  5499. "pathname": "/baz",
  5500. "search": "?qux",
  5501. "searchParams": "qux=",
  5502. "hash": "#foo%60bar"
  5503. },
  5504. "# IPv4 parsing (via https://github.com/nodejs/node/pull/10317)",
  5505. {
  5506. "input": "http://1.2.3.4/",
  5507. "base": "http://other.com/",
  5508. "href": "http://1.2.3.4/",
  5509. "origin": "http://1.2.3.4",
  5510. "protocol": "http:",
  5511. "username": "",
  5512. "password": "",
  5513. "host": "1.2.3.4",
  5514. "hostname": "1.2.3.4",
  5515. "port": "",
  5516. "pathname": "/",
  5517. "search": "",
  5518. "hash": ""
  5519. },
  5520. {
  5521. "input": "http://1.2.3.4./",
  5522. "base": "http://other.com/",
  5523. "href": "http://1.2.3.4/",
  5524. "origin": "http://1.2.3.4",
  5525. "protocol": "http:",
  5526. "username": "",
  5527. "password": "",
  5528. "host": "1.2.3.4",
  5529. "hostname": "1.2.3.4",
  5530. "port": "",
  5531. "pathname": "/",
  5532. "search": "",
  5533. "hash": ""
  5534. },
  5535. {
  5536. "input": "http://192.168.257",
  5537. "base": "http://other.com/",
  5538. "href": "http://192.168.1.1/",
  5539. "origin": "http://192.168.1.1",
  5540. "protocol": "http:",
  5541. "username": "",
  5542. "password": "",
  5543. "host": "192.168.1.1",
  5544. "hostname": "192.168.1.1",
  5545. "port": "",
  5546. "pathname": "/",
  5547. "search": "",
  5548. "hash": ""
  5549. },
  5550. {
  5551. "input": "http://192.168.257.",
  5552. "base": "http://other.com/",
  5553. "href": "http://192.168.1.1/",
  5554. "origin": "http://192.168.1.1",
  5555. "protocol": "http:",
  5556. "username": "",
  5557. "password": "",
  5558. "host": "192.168.1.1",
  5559. "hostname": "192.168.1.1",
  5560. "port": "",
  5561. "pathname": "/",
  5562. "search": "",
  5563. "hash": ""
  5564. },
  5565. {
  5566. "input": "http://192.168.257.com",
  5567. "base": "http://other.com/",
  5568. "href": "http://192.168.257.com/",
  5569. "origin": "http://192.168.257.com",
  5570. "protocol": "http:",
  5571. "username": "",
  5572. "password": "",
  5573. "host": "192.168.257.com",
  5574. "hostname": "192.168.257.com",
  5575. "port": "",
  5576. "pathname": "/",
  5577. "search": "",
  5578. "hash": ""
  5579. },
  5580. {
  5581. "input": "http://256",
  5582. "base": "http://other.com/",
  5583. "href": "http://0.0.1.0/",
  5584. "origin": "http://0.0.1.0",
  5585. "protocol": "http:",
  5586. "username": "",
  5587. "password": "",
  5588. "host": "0.0.1.0",
  5589. "hostname": "0.0.1.0",
  5590. "port": "",
  5591. "pathname": "/",
  5592. "search": "",
  5593. "hash": ""
  5594. },
  5595. {
  5596. "input": "http://256.com",
  5597. "base": "http://other.com/",
  5598. "href": "http://256.com/",
  5599. "origin": "http://256.com",
  5600. "protocol": "http:",
  5601. "username": "",
  5602. "password": "",
  5603. "host": "256.com",
  5604. "hostname": "256.com",
  5605. "port": "",
  5606. "pathname": "/",
  5607. "search": "",
  5608. "hash": ""
  5609. },
  5610. {
  5611. "input": "http://999999999",
  5612. "base": "http://other.com/",
  5613. "href": "http://59.154.201.255/",
  5614. "origin": "http://59.154.201.255",
  5615. "protocol": "http:",
  5616. "username": "",
  5617. "password": "",
  5618. "host": "59.154.201.255",
  5619. "hostname": "59.154.201.255",
  5620. "port": "",
  5621. "pathname": "/",
  5622. "search": "",
  5623. "hash": ""
  5624. },
  5625. {
  5626. "input": "http://999999999.",
  5627. "base": "http://other.com/",
  5628. "href": "http://59.154.201.255/",
  5629. "origin": "http://59.154.201.255",
  5630. "protocol": "http:",
  5631. "username": "",
  5632. "password": "",
  5633. "host": "59.154.201.255",
  5634. "hostname": "59.154.201.255",
  5635. "port": "",
  5636. "pathname": "/",
  5637. "search": "",
  5638. "hash": ""
  5639. },
  5640. {
  5641. "input": "http://999999999.com",
  5642. "base": "http://other.com/",
  5643. "href": "http://999999999.com/",
  5644. "origin": "http://999999999.com",
  5645. "protocol": "http:",
  5646. "username": "",
  5647. "password": "",
  5648. "host": "999999999.com",
  5649. "hostname": "999999999.com",
  5650. "port": "",
  5651. "pathname": "/",
  5652. "search": "",
  5653. "hash": ""
  5654. },
  5655. {
  5656. "input": "http://10000000000",
  5657. "base": "http://other.com/",
  5658. "failure": true
  5659. },
  5660. {
  5661. "input": "http://10000000000.com",
  5662. "base": "http://other.com/",
  5663. "href": "http://10000000000.com/",
  5664. "origin": "http://10000000000.com",
  5665. "protocol": "http:",
  5666. "username": "",
  5667. "password": "",
  5668. "host": "10000000000.com",
  5669. "hostname": "10000000000.com",
  5670. "port": "",
  5671. "pathname": "/",
  5672. "search": "",
  5673. "hash": ""
  5674. },
  5675. {
  5676. "input": "http://4294967295",
  5677. "base": "http://other.com/",
  5678. "href": "http://255.255.255.255/",
  5679. "origin": "http://255.255.255.255",
  5680. "protocol": "http:",
  5681. "username": "",
  5682. "password": "",
  5683. "host": "255.255.255.255",
  5684. "hostname": "255.255.255.255",
  5685. "port": "",
  5686. "pathname": "/",
  5687. "search": "",
  5688. "hash": ""
  5689. },
  5690. {
  5691. "input": "http://4294967296",
  5692. "base": "http://other.com/",
  5693. "failure": true
  5694. },
  5695. {
  5696. "input": "http://0xffffffff",
  5697. "base": "http://other.com/",
  5698. "href": "http://255.255.255.255/",
  5699. "origin": "http://255.255.255.255",
  5700. "protocol": "http:",
  5701. "username": "",
  5702. "password": "",
  5703. "host": "255.255.255.255",
  5704. "hostname": "255.255.255.255",
  5705. "port": "",
  5706. "pathname": "/",
  5707. "search": "",
  5708. "hash": ""
  5709. },
  5710. {
  5711. "input": "http://0xffffffff1",
  5712. "base": "http://other.com/",
  5713. "failure": true
  5714. },
  5715. {
  5716. "input": "http://256.256.256.256",
  5717. "base": "http://other.com/",
  5718. "failure": true
  5719. },
  5720. {
  5721. "input": "https://0x.0x.0",
  5722. "base": "about:blank",
  5723. "href": "https://0.0.0.0/",
  5724. "origin": "https://0.0.0.0",
  5725. "protocol": "https:",
  5726. "username": "",
  5727. "password": "",
  5728. "host": "0.0.0.0",
  5729. "hostname": "0.0.0.0",
  5730. "port": "",
  5731. "pathname": "/",
  5732. "search": "",
  5733. "hash": ""
  5734. },
  5735. "More IPv4 parsing (via https://github.com/jsdom/whatwg-url/issues/92)",
  5736. {
  5737. "input": "https://0x100000000/test",
  5738. "base": "about:blank",
  5739. "failure": true
  5740. },
  5741. {
  5742. "input": "https://256.0.0.1/test",
  5743. "base": "about:blank",
  5744. "failure": true
  5745. },
  5746. "# file URLs containing percent-encoded Windows drive letters (shouldn't work)",
  5747. {
  5748. "input": "file:///C%3A/",
  5749. "base": "about:blank",
  5750. "href": "file:///C%3A/",
  5751. "protocol": "file:",
  5752. "username": "",
  5753. "password": "",
  5754. "host": "",
  5755. "hostname": "",
  5756. "port": "",
  5757. "pathname": "/C%3A/",
  5758. "search": "",
  5759. "hash": ""
  5760. },
  5761. {
  5762. "input": "file:///C%7C/",
  5763. "base": "about:blank",
  5764. "href": "file:///C%7C/",
  5765. "protocol": "file:",
  5766. "username": "",
  5767. "password": "",
  5768. "host": "",
  5769. "hostname": "",
  5770. "port": "",
  5771. "pathname": "/C%7C/",
  5772. "search": "",
  5773. "hash": ""
  5774. },
  5775. {
  5776. "input": "file://%43%3A",
  5777. "base": "about:blank",
  5778. "failure": true
  5779. },
  5780. {
  5781. "input": "asdf://%43%7C/",
  5782. "base": "about:blank",
  5783. "href": "asdf://%43%7C/",
  5784. "origin": "null",
  5785. "protocol": "asdf:",
  5786. "username": "",
  5787. "password": "",
  5788. "host": "%43%7C",
  5789. "hostname": "%43%7C",
  5790. "port": "",
  5791. "pathname": "/",
  5792. "search": "",
  5793. "hash": ""
  5794. },
  5795. "# file URLs relative to other file URLs (via https://github.com/jsdom/whatwg-url/pull/60)",
  5796. {
  5797. "input": "pix/submit.gif",
  5798. "base": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html",
  5799. "href": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
  5800. "protocol": "file:",
  5801. "username": "",
  5802. "password": "",
  5803. "host": "",
  5804. "hostname": "",
  5805. "port": "",
  5806. "pathname": "/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
  5807. "search": "",
  5808. "hash": ""
  5809. },
  5810. {
  5811. "input": "..",
  5812. "base": "file:///C:/",
  5813. "href": "file:///C:/",
  5814. "protocol": "file:",
  5815. "username": "",
  5816. "password": "",
  5817. "host": "",
  5818. "hostname": "",
  5819. "port": "",
  5820. "pathname": "/C:/",
  5821. "search": "",
  5822. "hash": ""
  5823. },
  5824. {
  5825. "input": "..",
  5826. "base": "file:///",
  5827. "href": "file:///",
  5828. "protocol": "file:",
  5829. "username": "",
  5830. "password": "",
  5831. "host": "",
  5832. "hostname": "",
  5833. "port": "",
  5834. "pathname": "/",
  5835. "search": "",
  5836. "hash": ""
  5837. },
  5838. "# More file URL tests by zcorpan and annevk",
  5839. {
  5840. "input": "/",
  5841. "base": "file:///C:/a/b",
  5842. "href": "file:///C:/",
  5843. "protocol": "file:",
  5844. "username": "",
  5845. "password": "",
  5846. "host": "",
  5847. "hostname": "",
  5848. "port": "",
  5849. "pathname": "/C:/",
  5850. "search": "",
  5851. "hash": ""
  5852. },
  5853. {
  5854. "input": "/",
  5855. "base": "file://h/a/b",
  5856. "href": "file://h/",
  5857. "protocol": "file:",
  5858. "username": "",
  5859. "password": "",
  5860. "host": "h",
  5861. "hostname": "h",
  5862. "port": "",
  5863. "pathname": "/",
  5864. "search": "",
  5865. "hash": ""
  5866. },
  5867. {
  5868. "input": "//d:",
  5869. "base": "file:///C:/a/b",
  5870. "href": "file:///d:",
  5871. "protocol": "file:",
  5872. "username": "",
  5873. "password": "",
  5874. "host": "",
  5875. "hostname": "",
  5876. "port": "",
  5877. "pathname": "/d:",
  5878. "search": "",
  5879. "hash": ""
  5880. },
  5881. {
  5882. "input": "//d:/..",
  5883. "base": "file:///C:/a/b",
  5884. "href": "file:///d:/",
  5885. "protocol": "file:",
  5886. "username": "",
  5887. "password": "",
  5888. "host": "",
  5889. "hostname": "",
  5890. "port": "",
  5891. "pathname": "/d:/",
  5892. "search": "",
  5893. "hash": ""
  5894. },
  5895. {
  5896. "input": "..",
  5897. "base": "file:///ab:/",
  5898. "href": "file:///",
  5899. "protocol": "file:",
  5900. "username": "",
  5901. "password": "",
  5902. "host": "",
  5903. "hostname": "",
  5904. "port": "",
  5905. "pathname": "/",
  5906. "search": "",
  5907. "hash": ""
  5908. },
  5909. {
  5910. "input": "..",
  5911. "base": "file:///1:/",
  5912. "href": "file:///",
  5913. "protocol": "file:",
  5914. "username": "",
  5915. "password": "",
  5916. "host": "",
  5917. "hostname": "",
  5918. "port": "",
  5919. "pathname": "/",
  5920. "search": "",
  5921. "hash": ""
  5922. },
  5923. {
  5924. "input": "",
  5925. "base": "file:///test?test#test",
  5926. "href": "file:///test?test",
  5927. "protocol": "file:",
  5928. "username": "",
  5929. "password": "",
  5930. "host": "",
  5931. "hostname": "",
  5932. "port": "",
  5933. "pathname": "/test",
  5934. "search": "?test",
  5935. "hash": ""
  5936. },
  5937. {
  5938. "input": "file:",
  5939. "base": "file:///test?test#test",
  5940. "href": "file:///test?test",
  5941. "protocol": "file:",
  5942. "username": "",
  5943. "password": "",
  5944. "host": "",
  5945. "hostname": "",
  5946. "port": "",
  5947. "pathname": "/test",
  5948. "search": "?test",
  5949. "hash": ""
  5950. },
  5951. {
  5952. "input": "?x",
  5953. "base": "file:///test?test#test",
  5954. "href": "file:///test?x",
  5955. "protocol": "file:",
  5956. "username": "",
  5957. "password": "",
  5958. "host": "",
  5959. "hostname": "",
  5960. "port": "",
  5961. "pathname": "/test",
  5962. "search": "?x",
  5963. "hash": ""
  5964. },
  5965. {
  5966. "input": "file:?x",
  5967. "base": "file:///test?test#test",
  5968. "href": "file:///test?x",
  5969. "protocol": "file:",
  5970. "username": "",
  5971. "password": "",
  5972. "host": "",
  5973. "hostname": "",
  5974. "port": "",
  5975. "pathname": "/test",
  5976. "search": "?x",
  5977. "hash": ""
  5978. },
  5979. {
  5980. "input": "#x",
  5981. "base": "file:///test?test#test",
  5982. "href": "file:///test?test#x",
  5983. "protocol": "file:",
  5984. "username": "",
  5985. "password": "",
  5986. "host": "",
  5987. "hostname": "",
  5988. "port": "",
  5989. "pathname": "/test",
  5990. "search": "?test",
  5991. "hash": "#x"
  5992. },
  5993. {
  5994. "input": "file:#x",
  5995. "base": "file:///test?test#test",
  5996. "href": "file:///test?test#x",
  5997. "protocol": "file:",
  5998. "username": "",
  5999. "password": "",
  6000. "host": "",
  6001. "hostname": "",
  6002. "port": "",
  6003. "pathname": "/test",
  6004. "search": "?test",
  6005. "hash": "#x"
  6006. },
  6007. "# File URLs and many (back)slashes",
  6008. {
  6009. "input": "file:///localhost//cat",
  6010. "base": "about:blank",
  6011. "href": "file:///localhost//cat",
  6012. "protocol": "file:",
  6013. "username": "",
  6014. "password": "",
  6015. "host": "",
  6016. "hostname": "",
  6017. "port": "",
  6018. "pathname": "/localhost//cat",
  6019. "search": "",
  6020. "hash": ""
  6021. },
  6022. {
  6023. "input": "\\//pig",
  6024. "base": "file://lion/",
  6025. "href": "file:///pig",
  6026. "protocol": "file:",
  6027. "username": "",
  6028. "password": "",
  6029. "host": "",
  6030. "hostname": "",
  6031. "port": "",
  6032. "pathname": "/pig",
  6033. "search": "",
  6034. "hash": ""
  6035. },
  6036. {
  6037. "input": "file://",
  6038. "base": "file://ape/",
  6039. "href": "file:///",
  6040. "protocol": "file:",
  6041. "username": "",
  6042. "password": "",
  6043. "host": "",
  6044. "hostname": "",
  6045. "port": "",
  6046. "pathname": "/",
  6047. "search": "",
  6048. "hash": ""
  6049. },
  6050. "# File URLs with non-empty hosts",
  6051. {
  6052. "input": "/rooibos",
  6053. "base": "file://tea/",
  6054. "href": "file://tea/rooibos",
  6055. "protocol": "file:",
  6056. "username": "",
  6057. "password": "",
  6058. "host": "tea",
  6059. "hostname": "tea",
  6060. "port": "",
  6061. "pathname": "/rooibos",
  6062. "search": "",
  6063. "hash": ""
  6064. },
  6065. {
  6066. "input": "/?chai",
  6067. "base": "file://tea/",
  6068. "href": "file://tea/?chai",
  6069. "protocol": "file:",
  6070. "username": "",
  6071. "password": "",
  6072. "host": "tea",
  6073. "hostname": "tea",
  6074. "port": "",
  6075. "pathname": "/",
  6076. "search": "?chai",
  6077. "hash": ""
  6078. },
  6079. "# Windows drive letter handling with the 'file:' base URL",
  6080. {
  6081. "input": "C",
  6082. "base": "file://host/dir/file",
  6083. "href": "file://host/dir/C",
  6084. "protocol": "file:",
  6085. "username": "",
  6086. "password": "",
  6087. "host": "host",
  6088. "hostname": "host",
  6089. "port": "",
  6090. "pathname": "/dir/C",
  6091. "search": "",
  6092. "hash": ""
  6093. },
  6094. {
  6095. "input": "C|a",
  6096. "base": "file://host/dir/file",
  6097. "href": "file://host/dir/C|a",
  6098. "protocol": "file:",
  6099. "username": "",
  6100. "password": "",
  6101. "host": "host",
  6102. "hostname": "host",
  6103. "port": "",
  6104. "pathname": "/dir/C|a",
  6105. "search": "",
  6106. "hash": ""
  6107. },
  6108. "# Windows drive letter quirk in the file slash state",
  6109. {
  6110. "input": "/c:/foo/bar",
  6111. "base": "file:///c:/baz/qux",
  6112. "href": "file:///c:/foo/bar",
  6113. "protocol": "file:",
  6114. "username": "",
  6115. "password": "",
  6116. "host": "",
  6117. "hostname": "",
  6118. "port": "",
  6119. "pathname": "/c:/foo/bar",
  6120. "search": "",
  6121. "hash": ""
  6122. },
  6123. {
  6124. "input": "/c|/foo/bar",
  6125. "base": "file:///c:/baz/qux",
  6126. "href": "file:///c:/foo/bar",
  6127. "protocol": "file:",
  6128. "username": "",
  6129. "password": "",
  6130. "host": "",
  6131. "hostname": "",
  6132. "port": "",
  6133. "pathname": "/c:/foo/bar",
  6134. "search": "",
  6135. "hash": ""
  6136. },
  6137. {
  6138. "input": "file:\\c:\\foo\\bar",
  6139. "base": "file:///c:/baz/qux",
  6140. "href": "file:///c:/foo/bar",
  6141. "protocol": "file:",
  6142. "username": "",
  6143. "password": "",
  6144. "host": "",
  6145. "hostname": "",
  6146. "port": "",
  6147. "pathname": "/c:/foo/bar",
  6148. "search": "",
  6149. "hash": ""
  6150. },
  6151. "# Copy the empty host from the input in the following cases",
  6152. {
  6153. "input": "//C:/",
  6154. "base": "file://host/",
  6155. "href": "file:///C:/",
  6156. "protocol": "file:",
  6157. "username": "",
  6158. "password": "",
  6159. "host": "",
  6160. "hostname": "",
  6161. "port": "",
  6162. "pathname": "/C:/",
  6163. "search": "",
  6164. "hash": ""
  6165. },
  6166. {
  6167. "input": "file://C:/",
  6168. "base": "file://host/",
  6169. "href": "file:///C:/",
  6170. "protocol": "file:",
  6171. "username": "",
  6172. "password": "",
  6173. "host": "",
  6174. "hostname": "",
  6175. "port": "",
  6176. "pathname": "/C:/",
  6177. "search": "",
  6178. "hash": ""
  6179. },
  6180. {
  6181. "input": "///C:/",
  6182. "base": "file://host/",
  6183. "href": "file:///C:/",
  6184. "protocol": "file:",
  6185. "username": "",
  6186. "password": "",
  6187. "host": "",
  6188. "hostname": "",
  6189. "port": "",
  6190. "pathname": "/C:/",
  6191. "search": "",
  6192. "hash": ""
  6193. },
  6194. {
  6195. "input": "file:///C:/",
  6196. "base": "file://host/",
  6197. "href": "file:///C:/",
  6198. "protocol": "file:",
  6199. "username": "",
  6200. "password": "",
  6201. "host": "",
  6202. "hostname": "",
  6203. "port": "",
  6204. "pathname": "/C:/",
  6205. "search": "",
  6206. "hash": ""
  6207. },
  6208. "# Windows drive letter quirk (no host)",
  6209. {
  6210. "input": "file:/C|/",
  6211. "base": "about:blank",
  6212. "href": "file:///C:/",
  6213. "protocol": "file:",
  6214. "username": "",
  6215. "password": "",
  6216. "host": "",
  6217. "hostname": "",
  6218. "port": "",
  6219. "pathname": "/C:/",
  6220. "search": "",
  6221. "hash": ""
  6222. },
  6223. {
  6224. "input": "file://C|/",
  6225. "base": "about:blank",
  6226. "href": "file:///C:/",
  6227. "protocol": "file:",
  6228. "username": "",
  6229. "password": "",
  6230. "host": "",
  6231. "hostname": "",
  6232. "port": "",
  6233. "pathname": "/C:/",
  6234. "search": "",
  6235. "hash": ""
  6236. },
  6237. "# file URLs without base URL by Rimas Misevičius",
  6238. {
  6239. "input": "file:",
  6240. "base": "about:blank",
  6241. "href": "file:///",
  6242. "protocol": "file:",
  6243. "username": "",
  6244. "password": "",
  6245. "host": "",
  6246. "hostname": "",
  6247. "port": "",
  6248. "pathname": "/",
  6249. "search": "",
  6250. "hash": ""
  6251. },
  6252. {
  6253. "input": "file:?q=v",
  6254. "base": "about:blank",
  6255. "href": "file:///?q=v",
  6256. "protocol": "file:",
  6257. "username": "",
  6258. "password": "",
  6259. "host": "",
  6260. "hostname": "",
  6261. "port": "",
  6262. "pathname": "/",
  6263. "search": "?q=v",
  6264. "hash": ""
  6265. },
  6266. {
  6267. "input": "file:#frag",
  6268. "base": "about:blank",
  6269. "href": "file:///#frag",
  6270. "protocol": "file:",
  6271. "username": "",
  6272. "password": "",
  6273. "host": "",
  6274. "hostname": "",
  6275. "port": "",
  6276. "pathname": "/",
  6277. "search": "",
  6278. "hash": "#frag"
  6279. },
  6280. "# file: drive letter cases from https://crbug.com/1078698",
  6281. {
  6282. "input": "file:///Y:",
  6283. "base": "about:blank",
  6284. "href": "file:///Y:",
  6285. "protocol": "file:",
  6286. "username": "",
  6287. "password": "",
  6288. "host": "",
  6289. "hostname": "",
  6290. "port": "",
  6291. "pathname": "/Y:",
  6292. "search": "",
  6293. "hash": ""
  6294. },
  6295. {
  6296. "input": "file:///Y:/",
  6297. "base": "about:blank",
  6298. "href": "file:///Y:/",
  6299. "protocol": "file:",
  6300. "username": "",
  6301. "password": "",
  6302. "host": "",
  6303. "hostname": "",
  6304. "port": "",
  6305. "pathname": "/Y:/",
  6306. "search": "",
  6307. "hash": ""
  6308. },
  6309. {
  6310. "input": "file:///./Y",
  6311. "base": "about:blank",
  6312. "href": "file:///Y",
  6313. "protocol": "file:",
  6314. "username": "",
  6315. "password": "",
  6316. "host": "",
  6317. "hostname": "",
  6318. "port": "",
  6319. "pathname": "/Y",
  6320. "search": "",
  6321. "hash": ""
  6322. },
  6323. {
  6324. "input": "file:///./Y:",
  6325. "base": "about:blank",
  6326. "href": "file:///Y:",
  6327. "protocol": "file:",
  6328. "username": "",
  6329. "password": "",
  6330. "host": "",
  6331. "hostname": "",
  6332. "port": "",
  6333. "pathname": "/Y:",
  6334. "search": "",
  6335. "hash": ""
  6336. },
  6337. {
  6338. "input": "\\\\\\.\\Y:",
  6339. "base": "about:blank",
  6340. "failure": true,
  6341. "inputCanBeRelative": true
  6342. },
  6343. "# file: drive letter cases from https://crbug.com/1078698 but lowercased",
  6344. {
  6345. "input": "file:///y:",
  6346. "base": "about:blank",
  6347. "href": "file:///y:",
  6348. "protocol": "file:",
  6349. "username": "",
  6350. "password": "",
  6351. "host": "",
  6352. "hostname": "",
  6353. "port": "",
  6354. "pathname": "/y:",
  6355. "search": "",
  6356. "hash": ""
  6357. },
  6358. {
  6359. "input": "file:///y:/",
  6360. "base": "about:blank",
  6361. "href": "file:///y:/",
  6362. "protocol": "file:",
  6363. "username": "",
  6364. "password": "",
  6365. "host": "",
  6366. "hostname": "",
  6367. "port": "",
  6368. "pathname": "/y:/",
  6369. "search": "",
  6370. "hash": ""
  6371. },
  6372. {
  6373. "input": "file:///./y",
  6374. "base": "about:blank",
  6375. "href": "file:///y",
  6376. "protocol": "file:",
  6377. "username": "",
  6378. "password": "",
  6379. "host": "",
  6380. "hostname": "",
  6381. "port": "",
  6382. "pathname": "/y",
  6383. "search": "",
  6384. "hash": ""
  6385. },
  6386. {
  6387. "input": "file:///./y:",
  6388. "base": "about:blank",
  6389. "href": "file:///y:",
  6390. "protocol": "file:",
  6391. "username": "",
  6392. "password": "",
  6393. "host": "",
  6394. "hostname": "",
  6395. "port": "",
  6396. "pathname": "/y:",
  6397. "search": "",
  6398. "hash": ""
  6399. },
  6400. {
  6401. "input": "\\\\\\.\\y:",
  6402. "base": "about:blank",
  6403. "failure": true,
  6404. "inputCanBeRelative": true
  6405. },
  6406. "# Additional file URL tests for (https://github.com/whatwg/url/issues/405)",
  6407. {
  6408. "input": "file:///one/two",
  6409. "base": "file:///",
  6410. "href": "file:///one/two",
  6411. "protocol": "file:",
  6412. "username": "",
  6413. "password": "",
  6414. "host": "",
  6415. "hostname": "",
  6416. "port": "",
  6417. "pathname": "/one/two",
  6418. "search": "",
  6419. "hash": ""
  6420. },
  6421. {
  6422. "input": "//one/two",
  6423. "base": "file:///",
  6424. "href": "file://one/two",
  6425. "protocol": "file:",
  6426. "username": "",
  6427. "password": "",
  6428. "host": "one",
  6429. "hostname": "one",
  6430. "port": "",
  6431. "pathname": "/two",
  6432. "search": "",
  6433. "hash": ""
  6434. },
  6435. {
  6436. "input": "///one/two",
  6437. "base": "file:///",
  6438. "href": "file:///one/two",
  6439. "protocol": "file:",
  6440. "username": "",
  6441. "password": "",
  6442. "host": "",
  6443. "hostname": "",
  6444. "port": "",
  6445. "pathname": "/one/two",
  6446. "search": "",
  6447. "hash": ""
  6448. },
  6449. "# IPv6 tests",
  6450. {
  6451. "input": "http://[1:0::]",
  6452. "base": "http://example.net/",
  6453. "href": "http://[1::]/",
  6454. "origin": "http://[1::]",
  6455. "protocol": "http:",
  6456. "username": "",
  6457. "password": "",
  6458. "host": "[1::]",
  6459. "hostname": "[1::]",
  6460. "port": "",
  6461. "pathname": "/",
  6462. "search": "",
  6463. "hash": ""
  6464. },
  6465. {
  6466. "input": "http://[0:1:2:3:4:5:6:7:8]",
  6467. "base": "http://example.net/",
  6468. "failure": true
  6469. },
  6470. {
  6471. "input": "https://[0::0::0]",
  6472. "base": "about:blank",
  6473. "failure": true
  6474. },
  6475. {
  6476. "input": "https://[0:.0]",
  6477. "base": "about:blank",
  6478. "failure": true
  6479. },
  6480. {
  6481. "input": "https://[0:0:]",
  6482. "base": "about:blank",
  6483. "failure": true
  6484. },
  6485. {
  6486. "input": "https://[0:1:2:3:4:5:6:7.0.0.0.1]",
  6487. "base": "about:blank",
  6488. "failure": true
  6489. },
  6490. {
  6491. "input": "https://[0:1.00.0.0.0]",
  6492. "base": "about:blank",
  6493. "failure": true
  6494. },
  6495. {
  6496. "input": "https://[0:1.290.0.0.0]",
  6497. "base": "about:blank",
  6498. "failure": true
  6499. },
  6500. {
  6501. "input": "https://[0:1.23.23]",
  6502. "base": "about:blank",
  6503. "failure": true
  6504. },
  6505. "# Empty host",
  6506. {
  6507. "input": "http://?",
  6508. "base": "about:blank",
  6509. "failure": true
  6510. },
  6511. {
  6512. "input": "http://#",
  6513. "base": "about:blank",
  6514. "failure": true
  6515. },
  6516. "Port overflow (2^32 + 81)",
  6517. {
  6518. "input": "http://f:4294967377/c",
  6519. "base": "http://example.org/",
  6520. "failure": true
  6521. },
  6522. "Port overflow (2^64 + 81)",
  6523. {
  6524. "input": "http://f:18446744073709551697/c",
  6525. "base": "http://example.org/",
  6526. "failure": true
  6527. },
  6528. "Port overflow (2^128 + 81)",
  6529. {
  6530. "input": "http://f:340282366920938463463374607431768211537/c",
  6531. "base": "http://example.org/",
  6532. "failure": true
  6533. },
  6534. "# Non-special-URL path tests",
  6535. {
  6536. "input": "sc://ñ",
  6537. "base": "about:blank",
  6538. "href": "sc://%C3%B1",
  6539. "origin": "null",
  6540. "protocol": "sc:",
  6541. "username": "",
  6542. "password": "",
  6543. "host": "%C3%B1",
  6544. "hostname": "%C3%B1",
  6545. "port": "",
  6546. "pathname": "",
  6547. "search": "",
  6548. "hash": ""
  6549. },
  6550. {
  6551. "input": "sc://ñ?x",
  6552. "base": "about:blank",
  6553. "href": "sc://%C3%B1?x",
  6554. "origin": "null",
  6555. "protocol": "sc:",
  6556. "username": "",
  6557. "password": "",
  6558. "host": "%C3%B1",
  6559. "hostname": "%C3%B1",
  6560. "port": "",
  6561. "pathname": "",
  6562. "search": "?x",
  6563. "hash": ""
  6564. },
  6565. {
  6566. "input": "sc://ñ#x",
  6567. "base": "about:blank",
  6568. "href": "sc://%C3%B1#x",
  6569. "origin": "null",
  6570. "protocol": "sc:",
  6571. "username": "",
  6572. "password": "",
  6573. "host": "%C3%B1",
  6574. "hostname": "%C3%B1",
  6575. "port": "",
  6576. "pathname": "",
  6577. "search": "",
  6578. "hash": "#x"
  6579. },
  6580. {
  6581. "input": "#x",
  6582. "base": "sc://ñ",
  6583. "href": "sc://%C3%B1#x",
  6584. "origin": "null",
  6585. "protocol": "sc:",
  6586. "username": "",
  6587. "password": "",
  6588. "host": "%C3%B1",
  6589. "hostname": "%C3%B1",
  6590. "port": "",
  6591. "pathname": "",
  6592. "search": "",
  6593. "hash": "#x"
  6594. },
  6595. {
  6596. "input": "?x",
  6597. "base": "sc://ñ",
  6598. "href": "sc://%C3%B1?x",
  6599. "origin": "null",
  6600. "protocol": "sc:",
  6601. "username": "",
  6602. "password": "",
  6603. "host": "%C3%B1",
  6604. "hostname": "%C3%B1",
  6605. "port": "",
  6606. "pathname": "",
  6607. "search": "?x",
  6608. "hash": ""
  6609. },
  6610. {
  6611. "input": "sc://?",
  6612. "base": "about:blank",
  6613. "href": "sc://?",
  6614. "protocol": "sc:",
  6615. "username": "",
  6616. "password": "",
  6617. "host": "",
  6618. "hostname": "",
  6619. "port": "",
  6620. "pathname": "",
  6621. "search": "",
  6622. "hash": ""
  6623. },
  6624. {
  6625. "input": "sc://#",
  6626. "base": "about:blank",
  6627. "href": "sc://#",
  6628. "protocol": "sc:",
  6629. "username": "",
  6630. "password": "",
  6631. "host": "",
  6632. "hostname": "",
  6633. "port": "",
  6634. "pathname": "",
  6635. "search": "",
  6636. "hash": ""
  6637. },
  6638. {
  6639. "input": "///",
  6640. "base": "sc://x/",
  6641. "href": "sc:///",
  6642. "protocol": "sc:",
  6643. "username": "",
  6644. "password": "",
  6645. "host": "",
  6646. "hostname": "",
  6647. "port": "",
  6648. "pathname": "/",
  6649. "search": "",
  6650. "hash": ""
  6651. },
  6652. {
  6653. "input": "////",
  6654. "base": "sc://x/",
  6655. "href": "sc:////",
  6656. "protocol": "sc:",
  6657. "username": "",
  6658. "password": "",
  6659. "host": "",
  6660. "hostname": "",
  6661. "port": "",
  6662. "pathname": "//",
  6663. "search": "",
  6664. "hash": ""
  6665. },
  6666. {
  6667. "input": "////x/",
  6668. "base": "sc://x/",
  6669. "href": "sc:////x/",
  6670. "protocol": "sc:",
  6671. "username": "",
  6672. "password": "",
  6673. "host": "",
  6674. "hostname": "",
  6675. "port": "",
  6676. "pathname": "//x/",
  6677. "search": "",
  6678. "hash": ""
  6679. },
  6680. {
  6681. "input": "tftp://foobar.com/someconfig;mode=netascii",
  6682. "base": "about:blank",
  6683. "href": "tftp://foobar.com/someconfig;mode=netascii",
  6684. "origin": "null",
  6685. "protocol": "tftp:",
  6686. "username": "",
  6687. "password": "",
  6688. "host": "foobar.com",
  6689. "hostname": "foobar.com",
  6690. "port": "",
  6691. "pathname": "/someconfig;mode=netascii",
  6692. "search": "",
  6693. "hash": ""
  6694. },
  6695. {
  6696. "input": "telnet://user:pass@foobar.com:23/",
  6697. "base": "about:blank",
  6698. "href": "telnet://user:pass@foobar.com:23/",
  6699. "origin": "null",
  6700. "protocol": "telnet:",
  6701. "username": "user",
  6702. "password": "pass",
  6703. "host": "foobar.com:23",
  6704. "hostname": "foobar.com",
  6705. "port": "23",
  6706. "pathname": "/",
  6707. "search": "",
  6708. "hash": ""
  6709. },
  6710. {
  6711. "input": "ut2004://10.10.10.10:7777/Index.ut2",
  6712. "base": "about:blank",
  6713. "href": "ut2004://10.10.10.10:7777/Index.ut2",
  6714. "origin": "null",
  6715. "protocol": "ut2004:",
  6716. "username": "",
  6717. "password": "",
  6718. "host": "10.10.10.10:7777",
  6719. "hostname": "10.10.10.10",
  6720. "port": "7777",
  6721. "pathname": "/Index.ut2",
  6722. "search": "",
  6723. "hash": ""
  6724. },
  6725. {
  6726. "input": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz",
  6727. "base": "about:blank",
  6728. "href": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz",
  6729. "origin": "null",
  6730. "protocol": "redis:",
  6731. "username": "foo",
  6732. "password": "bar",
  6733. "host": "somehost:6379",
  6734. "hostname": "somehost",
  6735. "port": "6379",
  6736. "pathname": "/0",
  6737. "search": "?baz=bam&qux=baz",
  6738. "hash": ""
  6739. },
  6740. {
  6741. "input": "rsync://foo@host:911/sup",
  6742. "base": "about:blank",
  6743. "href": "rsync://foo@host:911/sup",
  6744. "origin": "null",
  6745. "protocol": "rsync:",
  6746. "username": "foo",
  6747. "password": "",
  6748. "host": "host:911",
  6749. "hostname": "host",
  6750. "port": "911",
  6751. "pathname": "/sup",
  6752. "search": "",
  6753. "hash": ""
  6754. },
  6755. {
  6756. "input": "git://github.com/foo/bar.git",
  6757. "base": "about:blank",
  6758. "href": "git://github.com/foo/bar.git",
  6759. "origin": "null",
  6760. "protocol": "git:",
  6761. "username": "",
  6762. "password": "",
  6763. "host": "github.com",
  6764. "hostname": "github.com",
  6765. "port": "",
  6766. "pathname": "/foo/bar.git",
  6767. "search": "",
  6768. "hash": ""
  6769. },
  6770. {
  6771. "input": "irc://myserver.com:6999/channel?passwd",
  6772. "base": "about:blank",
  6773. "href": "irc://myserver.com:6999/channel?passwd",
  6774. "origin": "null",
  6775. "protocol": "irc:",
  6776. "username": "",
  6777. "password": "",
  6778. "host": "myserver.com:6999",
  6779. "hostname": "myserver.com",
  6780. "port": "6999",
  6781. "pathname": "/channel",
  6782. "search": "?passwd",
  6783. "hash": ""
  6784. },
  6785. {
  6786. "input": "dns://fw.example.org:9999/foo.bar.org?type=TXT",
  6787. "base": "about:blank",
  6788. "href": "dns://fw.example.org:9999/foo.bar.org?type=TXT",
  6789. "origin": "null",
  6790. "protocol": "dns:",
  6791. "username": "",
  6792. "password": "",
  6793. "host": "fw.example.org:9999",
  6794. "hostname": "fw.example.org",
  6795. "port": "9999",
  6796. "pathname": "/foo.bar.org",
  6797. "search": "?type=TXT",
  6798. "hash": ""
  6799. },
  6800. {
  6801. "input": "ldap://localhost:389/ou=People,o=JNDITutorial",
  6802. "base": "about:blank",
  6803. "href": "ldap://localhost:389/ou=People,o=JNDITutorial",
  6804. "origin": "null",
  6805. "protocol": "ldap:",
  6806. "username": "",
  6807. "password": "",
  6808. "host": "localhost:389",
  6809. "hostname": "localhost",
  6810. "port": "389",
  6811. "pathname": "/ou=People,o=JNDITutorial",
  6812. "search": "",
  6813. "hash": ""
  6814. },
  6815. {
  6816. "input": "git+https://github.com/foo/bar",
  6817. "base": "about:blank",
  6818. "href": "git+https://github.com/foo/bar",
  6819. "origin": "null",
  6820. "protocol": "git+https:",
  6821. "username": "",
  6822. "password": "",
  6823. "host": "github.com",
  6824. "hostname": "github.com",
  6825. "port": "",
  6826. "pathname": "/foo/bar",
  6827. "search": "",
  6828. "hash": ""
  6829. },
  6830. {
  6831. "input": "urn:ietf:rfc:2648",
  6832. "base": "about:blank",
  6833. "href": "urn:ietf:rfc:2648",
  6834. "origin": "null",
  6835. "protocol": "urn:",
  6836. "username": "",
  6837. "password": "",
  6838. "host": "",
  6839. "hostname": "",
  6840. "port": "",
  6841. "pathname": "ietf:rfc:2648",
  6842. "search": "",
  6843. "hash": ""
  6844. },
  6845. {
  6846. "input": "tag:joe@example.org,2001:foo/bar",
  6847. "base": "about:blank",
  6848. "href": "tag:joe@example.org,2001:foo/bar",
  6849. "origin": "null",
  6850. "protocol": "tag:",
  6851. "username": "",
  6852. "password": "",
  6853. "host": "",
  6854. "hostname": "",
  6855. "port": "",
  6856. "pathname": "joe@example.org,2001:foo/bar",
  6857. "search": "",
  6858. "hash": ""
  6859. },
  6860. "# percent encoded hosts in non-special-URLs",
  6861. {
  6862. "input": "non-special://%E2%80%A0/",
  6863. "base": "about:blank",
  6864. "href": "non-special://%E2%80%A0/",
  6865. "protocol": "non-special:",
  6866. "username": "",
  6867. "password": "",
  6868. "host": "%E2%80%A0",
  6869. "hostname": "%E2%80%A0",
  6870. "port": "",
  6871. "pathname": "/",
  6872. "search": "",
  6873. "hash": ""
  6874. },
  6875. {
  6876. "input": "non-special://H%4fSt/path",
  6877. "base": "about:blank",
  6878. "href": "non-special://H%4fSt/path",
  6879. "protocol": "non-special:",
  6880. "username": "",
  6881. "password": "",
  6882. "host": "H%4fSt",
  6883. "hostname": "H%4fSt",
  6884. "port": "",
  6885. "pathname": "/path",
  6886. "search": "",
  6887. "hash": ""
  6888. },
  6889. "# IPv6 in non-special-URLs",
  6890. {
  6891. "input": "non-special://[1:2:0:0:5:0:0:0]/",
  6892. "base": "about:blank",
  6893. "href": "non-special://[1:2:0:0:5::]/",
  6894. "protocol": "non-special:",
  6895. "username": "",
  6896. "password": "",
  6897. "host": "[1:2:0:0:5::]",
  6898. "hostname": "[1:2:0:0:5::]",
  6899. "port": "",
  6900. "pathname": "/",
  6901. "search": "",
  6902. "hash": ""
  6903. },
  6904. {
  6905. "input": "non-special://[1:2:0:0:0:0:0:3]/",
  6906. "base": "about:blank",
  6907. "href": "non-special://[1:2::3]/",
  6908. "protocol": "non-special:",
  6909. "username": "",
  6910. "password": "",
  6911. "host": "[1:2::3]",
  6912. "hostname": "[1:2::3]",
  6913. "port": "",
  6914. "pathname": "/",
  6915. "search": "",
  6916. "hash": ""
  6917. },
  6918. {
  6919. "input": "non-special://[1:2::3]:80/",
  6920. "base": "about:blank",
  6921. "href": "non-special://[1:2::3]:80/",
  6922. "protocol": "non-special:",
  6923. "username": "",
  6924. "password": "",
  6925. "host": "[1:2::3]:80",
  6926. "hostname": "[1:2::3]",
  6927. "port": "80",
  6928. "pathname": "/",
  6929. "search": "",
  6930. "hash": ""
  6931. },
  6932. {
  6933. "input": "non-special://[:80/",
  6934. "base": "about:blank",
  6935. "failure": true
  6936. },
  6937. {
  6938. "input": "blob:https://example.com:443/",
  6939. "base": "about:blank",
  6940. "href": "blob:https://example.com:443/",
  6941. "origin": "https://example.com",
  6942. "protocol": "blob:",
  6943. "username": "",
  6944. "password": "",
  6945. "host": "",
  6946. "hostname": "",
  6947. "port": "",
  6948. "pathname": "https://example.com:443/",
  6949. "search": "",
  6950. "hash": ""
  6951. },
  6952. {
  6953. "input": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
  6954. "base": "about:blank",
  6955. "href": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
  6956. "origin": "null",
  6957. "protocol": "blob:",
  6958. "username": "",
  6959. "password": "",
  6960. "host": "",
  6961. "hostname": "",
  6962. "port": "",
  6963. "pathname": "d3958f5c-0777-0845-9dcf-2cb28783acaf",
  6964. "search": "",
  6965. "hash": ""
  6966. },
  6967. {
  6968. "input": "blob:",
  6969. "base": "about:blank",
  6970. "href": "blob:",
  6971. "origin": "null",
  6972. "protocol": "blob:",
  6973. "username": "",
  6974. "password": "",
  6975. "host": "",
  6976. "hostname": "",
  6977. "port": "",
  6978. "pathname": "",
  6979. "search": "",
  6980. "hash": ""
  6981. },
  6982. "Invalid IPv4 radix digits",
  6983. {
  6984. "input": "http://0x7f.0.0.0x7g",
  6985. "base": "about:blank",
  6986. "href": "http://0x7f.0.0.0x7g/",
  6987. "protocol": "http:",
  6988. "username": "",
  6989. "password": "",
  6990. "host": "0x7f.0.0.0x7g",
  6991. "hostname": "0x7f.0.0.0x7g",
  6992. "port": "",
  6993. "pathname": "/",
  6994. "search": "",
  6995. "hash": ""
  6996. },
  6997. {
  6998. "input": "http://0X7F.0.0.0X7G",
  6999. "base": "about:blank",
  7000. "href": "http://0x7f.0.0.0x7g/",
  7001. "protocol": "http:",
  7002. "username": "",
  7003. "password": "",
  7004. "host": "0x7f.0.0.0x7g",
  7005. "hostname": "0x7f.0.0.0x7g",
  7006. "port": "",
  7007. "pathname": "/",
  7008. "search": "",
  7009. "hash": ""
  7010. },
  7011. "Invalid IPv4 portion of IPv6 address",
  7012. {
  7013. "input": "http://[::127.0.0.0.1]",
  7014. "base": "about:blank",
  7015. "failure": true
  7016. },
  7017. "Uncompressed IPv6 addresses with 0",
  7018. {
  7019. "input": "http://[0:1:0:1:0:1:0:1]",
  7020. "base": "about:blank",
  7021. "href": "http://[0:1:0:1:0:1:0:1]/",
  7022. "protocol": "http:",
  7023. "username": "",
  7024. "password": "",
  7025. "host": "[0:1:0:1:0:1:0:1]",
  7026. "hostname": "[0:1:0:1:0:1:0:1]",
  7027. "port": "",
  7028. "pathname": "/",
  7029. "search": "",
  7030. "hash": ""
  7031. },
  7032. {
  7033. "input": "http://[1:0:1:0:1:0:1:0]",
  7034. "base": "about:blank",
  7035. "href": "http://[1:0:1:0:1:0:1:0]/",
  7036. "protocol": "http:",
  7037. "username": "",
  7038. "password": "",
  7039. "host": "[1:0:1:0:1:0:1:0]",
  7040. "hostname": "[1:0:1:0:1:0:1:0]",
  7041. "port": "",
  7042. "pathname": "/",
  7043. "search": "",
  7044. "hash": ""
  7045. },
  7046. "Percent-encoded query and fragment",
  7047. {
  7048. "input": "http://example.org/test?\u0022",
  7049. "base": "about:blank",
  7050. "href": "http://example.org/test?%22",
  7051. "protocol": "http:",
  7052. "username": "",
  7053. "password": "",
  7054. "host": "example.org",
  7055. "hostname": "example.org",
  7056. "port": "",
  7057. "pathname": "/test",
  7058. "search": "?%22",
  7059. "hash": ""
  7060. },
  7061. {
  7062. "input": "http://example.org/test?\u0023",
  7063. "base": "about:blank",
  7064. "href": "http://example.org/test?#",
  7065. "protocol": "http:",
  7066. "username": "",
  7067. "password": "",
  7068. "host": "example.org",
  7069. "hostname": "example.org",
  7070. "port": "",
  7071. "pathname": "/test",
  7072. "search": "",
  7073. "hash": ""
  7074. },
  7075. {
  7076. "input": "http://example.org/test?\u003C",
  7077. "base": "about:blank",
  7078. "href": "http://example.org/test?%3C",
  7079. "protocol": "http:",
  7080. "username": "",
  7081. "password": "",
  7082. "host": "example.org",
  7083. "hostname": "example.org",
  7084. "port": "",
  7085. "pathname": "/test",
  7086. "search": "?%3C",
  7087. "hash": ""
  7088. },
  7089. {
  7090. "input": "http://example.org/test?\u003E",
  7091. "base": "about:blank",
  7092. "href": "http://example.org/test?%3E",
  7093. "protocol": "http:",
  7094. "username": "",
  7095. "password": "",
  7096. "host": "example.org",
  7097. "hostname": "example.org",
  7098. "port": "",
  7099. "pathname": "/test",
  7100. "search": "?%3E",
  7101. "hash": ""
  7102. },
  7103. {
  7104. "input": "http://example.org/test?\u2323",
  7105. "base": "about:blank",
  7106. "href": "http://example.org/test?%E2%8C%A3",
  7107. "protocol": "http:",
  7108. "username": "",
  7109. "password": "",
  7110. "host": "example.org",
  7111. "hostname": "example.org",
  7112. "port": "",
  7113. "pathname": "/test",
  7114. "search": "?%E2%8C%A3",
  7115. "hash": ""
  7116. },
  7117. {
  7118. "input": "http://example.org/test?%23%23",
  7119. "base": "about:blank",
  7120. "href": "http://example.org/test?%23%23",
  7121. "protocol": "http:",
  7122. "username": "",
  7123. "password": "",
  7124. "host": "example.org",
  7125. "hostname": "example.org",
  7126. "port": "",
  7127. "pathname": "/test",
  7128. "search": "?%23%23",
  7129. "hash": ""
  7130. },
  7131. {
  7132. "input": "http://example.org/test?%GH",
  7133. "base": "about:blank",
  7134. "href": "http://example.org/test?%GH",
  7135. "protocol": "http:",
  7136. "username": "",
  7137. "password": "",
  7138. "host": "example.org",
  7139. "hostname": "example.org",
  7140. "port": "",
  7141. "pathname": "/test",
  7142. "search": "?%GH",
  7143. "hash": ""
  7144. },
  7145. {
  7146. "input": "http://example.org/test?a#%EF",
  7147. "base": "about:blank",
  7148. "href": "http://example.org/test?a#%EF",
  7149. "protocol": "http:",
  7150. "username": "",
  7151. "password": "",
  7152. "host": "example.org",
  7153. "hostname": "example.org",
  7154. "port": "",
  7155. "pathname": "/test",
  7156. "search": "?a",
  7157. "hash": "#%EF"
  7158. },
  7159. {
  7160. "input": "http://example.org/test?a#%GH",
  7161. "base": "about:blank",
  7162. "href": "http://example.org/test?a#%GH",
  7163. "protocol": "http:",
  7164. "username": "",
  7165. "password": "",
  7166. "host": "example.org",
  7167. "hostname": "example.org",
  7168. "port": "",
  7169. "pathname": "/test",
  7170. "search": "?a",
  7171. "hash": "#%GH"
  7172. },
  7173. "URLs that require a non-about:blank base. (Also serve as invalid base tests.)",
  7174. {
  7175. "input": "a",
  7176. "base": "about:blank",
  7177. "failure": true,
  7178. "inputCanBeRelative": true
  7179. },
  7180. {
  7181. "input": "a/",
  7182. "base": "about:blank",
  7183. "failure": true,
  7184. "inputCanBeRelative": true
  7185. },
  7186. {
  7187. "input": "a//",
  7188. "base": "about:blank",
  7189. "failure": true,
  7190. "inputCanBeRelative": true
  7191. },
  7192. "Bases that don't fail to parse but fail to be bases",
  7193. {
  7194. "input": "test-a-colon.html",
  7195. "base": "a:",
  7196. "failure": true
  7197. },
  7198. {
  7199. "input": "test-a-colon-b.html",
  7200. "base": "a:b",
  7201. "failure": true
  7202. },
  7203. "Other base URL tests, that must succeed",
  7204. {
  7205. "input": "test-a-colon-slash.html",
  7206. "base": "a:/",
  7207. "href": "a:/test-a-colon-slash.html",
  7208. "protocol": "a:",
  7209. "username": "",
  7210. "password": "",
  7211. "host": "",
  7212. "hostname": "",
  7213. "port": "",
  7214. "pathname": "/test-a-colon-slash.html",
  7215. "search": "",
  7216. "hash": ""
  7217. },
  7218. {
  7219. "input": "test-a-colon-slash-slash.html",
  7220. "base": "a://",
  7221. "href": "a:///test-a-colon-slash-slash.html",
  7222. "protocol": "a:",
  7223. "username": "",
  7224. "password": "",
  7225. "host": "",
  7226. "hostname": "",
  7227. "port": "",
  7228. "pathname": "/test-a-colon-slash-slash.html",
  7229. "search": "",
  7230. "hash": ""
  7231. },
  7232. {
  7233. "input": "test-a-colon-slash-b.html",
  7234. "base": "a:/b",
  7235. "href": "a:/test-a-colon-slash-b.html",
  7236. "protocol": "a:",
  7237. "username": "",
  7238. "password": "",
  7239. "host": "",
  7240. "hostname": "",
  7241. "port": "",
  7242. "pathname": "/test-a-colon-slash-b.html",
  7243. "search": "",
  7244. "hash": ""
  7245. },
  7246. {
  7247. "input": "test-a-colon-slash-slash-b.html",
  7248. "base": "a://b",
  7249. "href": "a://b/test-a-colon-slash-slash-b.html",
  7250. "protocol": "a:",
  7251. "username": "",
  7252. "password": "",
  7253. "host": "b",
  7254. "hostname": "b",
  7255. "port": "",
  7256. "pathname": "/test-a-colon-slash-slash-b.html",
  7257. "search": "",
  7258. "hash": ""
  7259. },
  7260. "Null code point in fragment",
  7261. {
  7262. "input": "http://example.org/test?a#b\u0000c",
  7263. "base": "about:blank",
  7264. "href": "http://example.org/test?a#b%00c",
  7265. "protocol": "http:",
  7266. "username": "",
  7267. "password": "",
  7268. "host": "example.org",
  7269. "hostname": "example.org",
  7270. "port": "",
  7271. "pathname": "/test",
  7272. "search": "?a",
  7273. "hash": "#b%00c"
  7274. },
  7275. {
  7276. "input": "non-spec://example.org/test?a#b\u0000c",
  7277. "base": "about:blank",
  7278. "href": "non-spec://example.org/test?a#b%00c",
  7279. "protocol": "non-spec:",
  7280. "username": "",
  7281. "password": "",
  7282. "host": "example.org",
  7283. "hostname": "example.org",
  7284. "port": "",
  7285. "pathname": "/test",
  7286. "search": "?a",
  7287. "hash": "#b%00c"
  7288. },
  7289. {
  7290. "input": "non-spec:/test?a#b\u0000c",
  7291. "base": "about:blank",
  7292. "href": "non-spec:/test?a#b%00c",
  7293. "protocol": "non-spec:",
  7294. "username": "",
  7295. "password": "",
  7296. "host": "",
  7297. "hostname": "",
  7298. "port": "",
  7299. "pathname": "/test",
  7300. "search": "?a",
  7301. "hash": "#b%00c"
  7302. },
  7303. "First scheme char - not allowed: https://github.com/whatwg/url/issues/464",
  7304. {
  7305. "input": "10.0.0.7:8080/foo.html",
  7306. "base": "file:///some/dir/bar.html",
  7307. "href": "file:///some/dir/10.0.0.7:8080/foo.html",
  7308. "protocol": "file:",
  7309. "username": "",
  7310. "password": "",
  7311. "host": "",
  7312. "hostname": "",
  7313. "port": "",
  7314. "pathname": "/some/dir/10.0.0.7:8080/foo.html",
  7315. "search": "",
  7316. "hash": ""
  7317. },
  7318. "Subsequent scheme chars - not allowed",
  7319. {
  7320. "input": "a!@$*=/foo.html",
  7321. "base": "file:///some/dir/bar.html",
  7322. "href": "file:///some/dir/a!@$*=/foo.html",
  7323. "protocol": "file:",
  7324. "username": "",
  7325. "password": "",
  7326. "host": "",
  7327. "hostname": "",
  7328. "port": "",
  7329. "pathname": "/some/dir/a!@$*=/foo.html",
  7330. "search": "",
  7331. "hash": ""
  7332. },
  7333. "First and subsequent scheme chars - allowed",
  7334. {
  7335. "input": "a1234567890-+.:foo/bar",
  7336. "base": "http://example.com/dir/file",
  7337. "href": "a1234567890-+.:foo/bar",
  7338. "protocol": "a1234567890-+.:",
  7339. "username": "",
  7340. "password": "",
  7341. "host": "",
  7342. "hostname": "",
  7343. "port": "",
  7344. "pathname": "foo/bar",
  7345. "search": "",
  7346. "hash": ""
  7347. },
  7348. "IDNA ignored code points in file URLs hosts",
  7349. {
  7350. "input": "file://a\u00ADb/p",
  7351. "base": "about:blank",
  7352. "href": "file://ab/p",
  7353. "protocol": "file:",
  7354. "username": "",
  7355. "password": "",
  7356. "host": "ab",
  7357. "hostname": "ab",
  7358. "port": "",
  7359. "pathname": "/p",
  7360. "search": "",
  7361. "hash": ""
  7362. },
  7363. {
  7364. "input": "file://a%C2%ADb/p",
  7365. "base": "about:blank",
  7366. "href": "file://ab/p",
  7367. "protocol": "file:",
  7368. "username": "",
  7369. "password": "",
  7370. "host": "ab",
  7371. "hostname": "ab",
  7372. "port": "",
  7373. "pathname": "/p",
  7374. "search": "",
  7375. "hash": ""
  7376. },
  7377. "Empty host after the domain to ASCII",
  7378. {
  7379. "input": "file://\u00ad/p",
  7380. "base": "about:blank",
  7381. "failure": true
  7382. },
  7383. {
  7384. "input": "file://%C2%AD/p",
  7385. "base": "about:blank",
  7386. "failure": true
  7387. },
  7388. {
  7389. "input": "file://xn--/p",
  7390. "base": "about:blank",
  7391. "failure": true
  7392. },
  7393. "https://bugzilla.mozilla.org/show_bug.cgi?id=1647058",
  7394. {
  7395. "input": "#link",
  7396. "base": "https://example.org/##link",
  7397. "href": "https://example.org/#link",
  7398. "protocol": "https:",
  7399. "username": "",
  7400. "password": "",
  7401. "host": "example.org",
  7402. "hostname": "example.org",
  7403. "port": "",
  7404. "pathname": "/",
  7405. "search": "",
  7406. "hash": "#link"
  7407. },
  7408. "UTF-8 percent-encode of C0 control percent-encode set and supersets",
  7409. {
  7410. "input": "non-special:cannot-be-a-base-url-\u0000\u0001\u001F\u001E\u007E\u007F\u0080",
  7411. "base": "about:blank",
  7412. "hash": "",
  7413. "host": "",
  7414. "hostname": "",
  7415. "href": "non-special:cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80",
  7416. "origin": "null",
  7417. "password": "",
  7418. "pathname": "cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80",
  7419. "port": "",
  7420. "protocol": "non-special:",
  7421. "search": "",
  7422. "username": ""
  7423. },
  7424. {
  7425. "input": "https://www.example.com/path{\u007Fpath.html?query'\u007F=query#fragment<\u007Ffragment",
  7426. "base": "about:blank",
  7427. "hash": "#fragment%3C%7Ffragment",
  7428. "host": "www.example.com",
  7429. "hostname": "www.example.com",
  7430. "href": "https://www.example.com/path%7B%7Fpath.html?query%27%7F=query#fragment%3C%7Ffragment",
  7431. "origin": "https://www.example.com",
  7432. "password": "",
  7433. "pathname": "/path%7B%7Fpath.html",
  7434. "port": "",
  7435. "protocol": "https:",
  7436. "search": "?query%27%7F=query",
  7437. "username": ""
  7438. },
  7439. {
  7440. "input": "https://user:pass[\u007F@foo/bar",
  7441. "base": "http://example.org",
  7442. "hash": "",
  7443. "host": "foo",
  7444. "hostname": "foo",
  7445. "href": "https://user:pass%5B%7F@foo/bar",
  7446. "origin": "https://foo",
  7447. "password": "pass%5B%7F",
  7448. "pathname": "/bar",
  7449. "port": "",
  7450. "protocol": "https:",
  7451. "search": "",
  7452. "username": "user"
  7453. },
  7454. "Tests for the distinct percent-encode sets",
  7455. {
  7456. "input": "foo:// !\"$%&'()*+,-.;<=>@[\\]^_`{|}~@host/",
  7457. "base": "about:blank",
  7458. "hash": "",
  7459. "host": "host",
  7460. "hostname": "host",
  7461. "href": "foo://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/",
  7462. "origin": "null",
  7463. "password": "",
  7464. "pathname": "/",
  7465. "port":"",
  7466. "protocol": "foo:",
  7467. "search": "",
  7468. "username": "%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~"
  7469. },
  7470. {
  7471. "input": "wss:// !\"$%&'()*+,-.;<=>@[]^_`{|}~@host/",
  7472. "base": "about:blank",
  7473. "hash": "",
  7474. "host": "host",
  7475. "hostname": "host",
  7476. "href": "wss://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/",
  7477. "origin": "wss://host",
  7478. "password": "",
  7479. "pathname": "/",
  7480. "port":"",
  7481. "protocol": "wss:",
  7482. "search": "",
  7483. "username": "%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~"
  7484. },
  7485. {
  7486. "input": "foo://joe: !\"$%&'()*+,-.:;<=>@[\\]^_`{|}~@host/",
  7487. "base": "about:blank",
  7488. "hash": "",
  7489. "host": "host",
  7490. "hostname": "host",
  7491. "href": "foo://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/",
  7492. "origin": "null",
  7493. "password": "%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~",
  7494. "pathname": "/",
  7495. "port":"",
  7496. "protocol": "foo:",
  7497. "search": "",
  7498. "username": "joe"
  7499. },
  7500. {
  7501. "input": "wss://joe: !\"$%&'()*+,-.:;<=>@[]^_`{|}~@host/",
  7502. "base": "about:blank",
  7503. "hash": "",
  7504. "host": "host",
  7505. "hostname": "host",
  7506. "href": "wss://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/",
  7507. "origin": "wss://host",
  7508. "password": "%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~",
  7509. "pathname": "/",
  7510. "port":"",
  7511. "protocol": "wss:",
  7512. "search": "",
  7513. "username": "joe"
  7514. },
  7515. {
  7516. "input": "foo://!\"$%&'()*+,-.;=_`{}~/",
  7517. "base": "about:blank",
  7518. "hash": "",
  7519. "host": "!\"$%&'()*+,-.;=_`{}~",
  7520. "hostname": "!\"$%&'()*+,-.;=_`{}~",
  7521. "href":"foo://!\"$%&'()*+,-.;=_`{}~/",
  7522. "origin": "null",
  7523. "password": "",
  7524. "pathname": "/",
  7525. "port":"",
  7526. "protocol": "foo:",
  7527. "search": "",
  7528. "username": ""
  7529. },
  7530. {
  7531. "input": "wss://!\"$&'()*+,-.;=_`{}~/",
  7532. "base": "about:blank",
  7533. "hash": "",
  7534. "host": "!\"$&'()*+,-.;=_`{}~",
  7535. "hostname": "!\"$&'()*+,-.;=_`{}~",
  7536. "href":"wss://!\"$&'()*+,-.;=_`{}~/",
  7537. "origin": "wss://!\"$&'()*+,-.;=_`{}~",
  7538. "password": "",
  7539. "pathname": "/",
  7540. "port":"",
  7541. "protocol": "wss:",
  7542. "search": "",
  7543. "username": ""
  7544. },
  7545. {
  7546. "input": "foo://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~",
  7547. "base": "about:blank",
  7548. "hash": "",
  7549. "host": "host",
  7550. "hostname": "host",
  7551. "href": "foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
  7552. "origin": "null",
  7553. "password": "",
  7554. "pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
  7555. "port":"",
  7556. "protocol": "foo:",
  7557. "search": "",
  7558. "username": ""
  7559. },
  7560. {
  7561. "input": "wss://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~",
  7562. "base": "about:blank",
  7563. "hash": "",
  7564. "host": "host",
  7565. "hostname": "host",
  7566. "href": "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~",
  7567. "origin": "wss://host",
  7568. "password": "",
  7569. "pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~",
  7570. "port":"",
  7571. "protocol": "wss:",
  7572. "search": "",
  7573. "username": ""
  7574. },
  7575. {
  7576. "input": "foo://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
  7577. "base": "about:blank",
  7578. "hash": "",
  7579. "host": "host",
  7580. "hostname": "host",
  7581. "href": "foo://host/dir/?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
  7582. "origin": "null",
  7583. "password": "",
  7584. "pathname": "/dir/",
  7585. "port":"",
  7586. "protocol": "foo:",
  7587. "search": "?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
  7588. "username": ""
  7589. },
  7590. {
  7591. "input": "wss://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
  7592. "base": "about:blank",
  7593. "hash": "",
  7594. "host": "host",
  7595. "hostname": "host",
  7596. "href": "wss://host/dir/?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
  7597. "origin": "wss://host",
  7598. "password": "",
  7599. "pathname": "/dir/",
  7600. "port":"",
  7601. "protocol": "wss:",
  7602. "search": "?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
  7603. "username": ""
  7604. },
  7605. {
  7606. "input": "foo://host/dir/# !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
  7607. "base": "about:blank",
  7608. "hash": "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
  7609. "host": "host",
  7610. "hostname": "host",
  7611. "href": "foo://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
  7612. "origin": "null",
  7613. "password": "",
  7614. "pathname": "/dir/",
  7615. "port":"",
  7616. "protocol": "foo:",
  7617. "search": "",
  7618. "username": ""
  7619. },
  7620. {
  7621. "input": "wss://host/dir/# !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
  7622. "base": "about:blank",
  7623. "hash": "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
  7624. "host": "host",
  7625. "hostname": "host",
  7626. "href": "wss://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
  7627. "origin": "wss://host",
  7628. "password": "",
  7629. "pathname": "/dir/",
  7630. "port":"",
  7631. "protocol": "wss:",
  7632. "search": "",
  7633. "username": ""
  7634. },
  7635. "Ensure that input schemes are not ignored when resolving non-special URLs",
  7636. {
  7637. "input": "abc:rootless",
  7638. "base": "abc://host/path",
  7639. "hash": "",
  7640. "host": "",
  7641. "hostname": "",
  7642. "href":"abc:rootless",
  7643. "password": "",
  7644. "pathname": "rootless",
  7645. "port":"",
  7646. "protocol": "abc:",
  7647. "search": "",
  7648. "username": ""
  7649. },
  7650. {
  7651. "input": "abc:rootless",
  7652. "base": "abc:/path",
  7653. "hash": "",
  7654. "host": "",
  7655. "hostname": "",
  7656. "href":"abc:rootless",
  7657. "password": "",
  7658. "pathname": "rootless",
  7659. "port":"",
  7660. "protocol": "abc:",
  7661. "search": "",
  7662. "username": ""
  7663. },
  7664. {
  7665. "input": "abc:rootless",
  7666. "base": "abc:path",
  7667. "hash": "",
  7668. "host": "",
  7669. "hostname": "",
  7670. "href":"abc:rootless",
  7671. "password": "",
  7672. "pathname": "rootless",
  7673. "port":"",
  7674. "protocol": "abc:",
  7675. "search": "",
  7676. "username": ""
  7677. },
  7678. {
  7679. "input": "abc:/rooted",
  7680. "base": "abc://host/path",
  7681. "hash": "",
  7682. "host": "",
  7683. "hostname": "",
  7684. "href":"abc:/rooted",
  7685. "password": "",
  7686. "pathname": "/rooted",
  7687. "port":"",
  7688. "protocol": "abc:",
  7689. "search": "",
  7690. "username": ""
  7691. }
  7692. ]