urltestdata.json 191 KB

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