urltestdata.json 143 KB

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