urltestdata.json 190 KB

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