urltestdata.json 133 KB

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