urltestdata.json 133 KB

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