urltestdata.json 151 KB

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