urltestdata.json 145 KB

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