urltestdata.json 101 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555
  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": "http:foo.com",
  65. "base": "http://example.org/foo/bar",
  66. "href": "http://example.org/foo/foo.com",
  67. "origin": "http://example.org",
  68. "protocol": "http:",
  69. "username": "",
  70. "password": "",
  71. "host": "example.org",
  72. "hostname": "example.org",
  73. "port": "",
  74. "pathname": "/foo/foo.com",
  75. "search": "",
  76. "hash": ""
  77. },
  78. {
  79. "input": "\t :foo.com \n",
  80. "base": "http://example.org/foo/bar",
  81. "href": "http://example.org/foo/:foo.com",
  82. "origin": "http://example.org",
  83. "protocol": "http:",
  84. "username": "",
  85. "password": "",
  86. "host": "example.org",
  87. "hostname": "example.org",
  88. "port": "",
  89. "pathname": "/foo/:foo.com",
  90. "search": "",
  91. "hash": ""
  92. },
  93. {
  94. "input": " 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": "a:\t foo.com",
  110. "base": "http://example.org/foo/bar",
  111. "href": "a: foo.com",
  112. "origin": "null",
  113. "protocol": "a:",
  114. "username": "",
  115. "password": "",
  116. "host": "",
  117. "hostname": "",
  118. "port": "",
  119. "pathname": " foo.com",
  120. "search": "",
  121. "hash": ""
  122. },
  123. {
  124. "input": "http://f:21/ b ? d # e ",
  125. "base": "http://example.org/foo/bar",
  126. "href": "http://f:21/%20b%20?%20d%20# e",
  127. "origin": "http://f:21",
  128. "protocol": "http:",
  129. "username": "",
  130. "password": "",
  131. "host": "f:21",
  132. "hostname": "f",
  133. "port": "21",
  134. "pathname": "/%20b%20",
  135. "search": "?%20d%20",
  136. "hash": "# e"
  137. },
  138. {
  139. "input": "http://f:/c",
  140. "base": "http://example.org/foo/bar",
  141. "href": "http://f/c",
  142. "origin": "http://f",
  143. "protocol": "http:",
  144. "username": "",
  145. "password": "",
  146. "host": "f",
  147. "hostname": "f",
  148. "port": "",
  149. "pathname": "/c",
  150. "search": "",
  151. "hash": ""
  152. },
  153. {
  154. "input": "http://f:0/c",
  155. "base": "http://example.org/foo/bar",
  156. "href": "http://f:0/c",
  157. "origin": "http://f:0",
  158. "protocol": "http:",
  159. "username": "",
  160. "password": "",
  161. "host": "f:0",
  162. "hostname": "f",
  163. "port": "0",
  164. "pathname": "/c",
  165. "search": "",
  166. "hash": ""
  167. },
  168. {
  169. "input": "http://f:00000000000000/c",
  170. "base": "http://example.org/foo/bar",
  171. "href": "http://f:0/c",
  172. "origin": "http://f:0",
  173. "protocol": "http:",
  174. "username": "",
  175. "password": "",
  176. "host": "f:0",
  177. "hostname": "f",
  178. "port": "0",
  179. "pathname": "/c",
  180. "search": "",
  181. "hash": ""
  182. },
  183. {
  184. "input": "http://f:00000000000000000000080/c",
  185. "base": "http://example.org/foo/bar",
  186. "href": "http://f/c",
  187. "origin": "http://f",
  188. "protocol": "http:",
  189. "username": "",
  190. "password": "",
  191. "host": "f",
  192. "hostname": "f",
  193. "port": "",
  194. "pathname": "/c",
  195. "search": "",
  196. "hash": ""
  197. },
  198. {
  199. "input": "http://f:b/c",
  200. "base": "http://example.org/foo/bar",
  201. "failure": true
  202. },
  203. {
  204. "input": "http://f: /c",
  205. "base": "http://example.org/foo/bar",
  206. "failure": true
  207. },
  208. {
  209. "input": "http://f:\n/c",
  210. "base": "http://example.org/foo/bar",
  211. "href": "http://f/c",
  212. "origin": "http://f",
  213. "protocol": "http:",
  214. "username": "",
  215. "password": "",
  216. "host": "f",
  217. "hostname": "f",
  218. "port": "",
  219. "pathname": "/c",
  220. "search": "",
  221. "hash": ""
  222. },
  223. {
  224. "input": "http://f:fifty-two/c",
  225. "base": "http://example.org/foo/bar",
  226. "failure": true
  227. },
  228. {
  229. "input": "http://f:999999/c",
  230. "base": "http://example.org/foo/bar",
  231. "failure": true
  232. },
  233. {
  234. "input": "http://f: 21 / b ? d # e ",
  235. "base": "http://example.org/foo/bar",
  236. "failure": true
  237. },
  238. {
  239. "input": "",
  240. "base": "http://example.org/foo/bar",
  241. "href": "http://example.org/foo/bar",
  242. "origin": "http://example.org",
  243. "protocol": "http:",
  244. "username": "",
  245. "password": "",
  246. "host": "example.org",
  247. "hostname": "example.org",
  248. "port": "",
  249. "pathname": "/foo/bar",
  250. "search": "",
  251. "hash": ""
  252. },
  253. {
  254. "input": " \t",
  255. "base": "http://example.org/foo/bar",
  256. "href": "http://example.org/foo/bar",
  257. "origin": "http://example.org",
  258. "protocol": "http:",
  259. "username": "",
  260. "password": "",
  261. "host": "example.org",
  262. "hostname": "example.org",
  263. "port": "",
  264. "pathname": "/foo/bar",
  265. "search": "",
  266. "hash": ""
  267. },
  268. {
  269. "input": ":foo.com/",
  270. "base": "http://example.org/foo/bar",
  271. "href": "http://example.org/foo/:foo.com/",
  272. "origin": "http://example.org",
  273. "protocol": "http:",
  274. "username": "",
  275. "password": "",
  276. "host": "example.org",
  277. "hostname": "example.org",
  278. "port": "",
  279. "pathname": "/foo/:foo.com/",
  280. "search": "",
  281. "hash": ""
  282. },
  283. {
  284. "input": ":foo.com\\",
  285. "base": "http://example.org/foo/bar",
  286. "href": "http://example.org/foo/:foo.com/",
  287. "origin": "http://example.org",
  288. "protocol": "http:",
  289. "username": "",
  290. "password": "",
  291. "host": "example.org",
  292. "hostname": "example.org",
  293. "port": "",
  294. "pathname": "/foo/:foo.com/",
  295. "search": "",
  296. "hash": ""
  297. },
  298. {
  299. "input": ":",
  300. "base": "http://example.org/foo/bar",
  301. "href": "http://example.org/foo/:",
  302. "origin": "http://example.org",
  303. "protocol": "http:",
  304. "username": "",
  305. "password": "",
  306. "host": "example.org",
  307. "hostname": "example.org",
  308. "port": "",
  309. "pathname": "/foo/:",
  310. "search": "",
  311. "hash": ""
  312. },
  313. {
  314. "input": ":a",
  315. "base": "http://example.org/foo/bar",
  316. "href": "http://example.org/foo/:a",
  317. "origin": "http://example.org",
  318. "protocol": "http:",
  319. "username": "",
  320. "password": "",
  321. "host": "example.org",
  322. "hostname": "example.org",
  323. "port": "",
  324. "pathname": "/foo/:a",
  325. "search": "",
  326. "hash": ""
  327. },
  328. {
  329. "input": ":/",
  330. "base": "http://example.org/foo/bar",
  331. "href": "http://example.org/foo/:/",
  332. "origin": "http://example.org",
  333. "protocol": "http:",
  334. "username": "",
  335. "password": "",
  336. "host": "example.org",
  337. "hostname": "example.org",
  338. "port": "",
  339. "pathname": "/foo/:/",
  340. "search": "",
  341. "hash": ""
  342. },
  343. {
  344. "input": ":\\",
  345. "base": "http://example.org/foo/bar",
  346. "href": "http://example.org/foo/:/",
  347. "origin": "http://example.org",
  348. "protocol": "http:",
  349. "username": "",
  350. "password": "",
  351. "host": "example.org",
  352. "hostname": "example.org",
  353. "port": "",
  354. "pathname": "/foo/:/",
  355. "search": "",
  356. "hash": ""
  357. },
  358. {
  359. "input": ":#",
  360. "base": "http://example.org/foo/bar",
  361. "href": "http://example.org/foo/:#",
  362. "origin": "http://example.org",
  363. "protocol": "http:",
  364. "username": "",
  365. "password": "",
  366. "host": "example.org",
  367. "hostname": "example.org",
  368. "port": "",
  369. "pathname": "/foo/:",
  370. "search": "",
  371. "hash": ""
  372. },
  373. {
  374. "input": "#",
  375. "base": "http://example.org/foo/bar",
  376. "href": "http://example.org/foo/bar#",
  377. "origin": "http://example.org",
  378. "protocol": "http:",
  379. "username": "",
  380. "password": "",
  381. "host": "example.org",
  382. "hostname": "example.org",
  383. "port": "",
  384. "pathname": "/foo/bar",
  385. "search": "",
  386. "hash": ""
  387. },
  388. {
  389. "input": "#/",
  390. "base": "http://example.org/foo/bar",
  391. "href": "http://example.org/foo/bar#/",
  392. "origin": "http://example.org",
  393. "protocol": "http:",
  394. "username": "",
  395. "password": "",
  396. "host": "example.org",
  397. "hostname": "example.org",
  398. "port": "",
  399. "pathname": "/foo/bar",
  400. "search": "",
  401. "hash": "#/"
  402. },
  403. {
  404. "input": "#\\",
  405. "base": "http://example.org/foo/bar",
  406. "href": "http://example.org/foo/bar#\\",
  407. "origin": "http://example.org",
  408. "protocol": "http:",
  409. "username": "",
  410. "password": "",
  411. "host": "example.org",
  412. "hostname": "example.org",
  413. "port": "",
  414. "pathname": "/foo/bar",
  415. "search": "",
  416. "hash": "#\\"
  417. },
  418. {
  419. "input": "#;?",
  420. "base": "http://example.org/foo/bar",
  421. "href": "http://example.org/foo/bar#;?",
  422. "origin": "http://example.org",
  423. "protocol": "http:",
  424. "username": "",
  425. "password": "",
  426. "host": "example.org",
  427. "hostname": "example.org",
  428. "port": "",
  429. "pathname": "/foo/bar",
  430. "search": "",
  431. "hash": "#;?"
  432. },
  433. {
  434. "input": "?",
  435. "base": "http://example.org/foo/bar",
  436. "href": "http://example.org/foo/bar?",
  437. "origin": "http://example.org",
  438. "protocol": "http:",
  439. "username": "",
  440. "password": "",
  441. "host": "example.org",
  442. "hostname": "example.org",
  443. "port": "",
  444. "pathname": "/foo/bar",
  445. "search": "",
  446. "hash": ""
  447. },
  448. {
  449. "input": "/",
  450. "base": "http://example.org/foo/bar",
  451. "href": "http://example.org/",
  452. "origin": "http://example.org",
  453. "protocol": "http:",
  454. "username": "",
  455. "password": "",
  456. "host": "example.org",
  457. "hostname": "example.org",
  458. "port": "",
  459. "pathname": "/",
  460. "search": "",
  461. "hash": ""
  462. },
  463. {
  464. "input": ":23",
  465. "base": "http://example.org/foo/bar",
  466. "href": "http://example.org/foo/:23",
  467. "origin": "http://example.org",
  468. "protocol": "http:",
  469. "username": "",
  470. "password": "",
  471. "host": "example.org",
  472. "hostname": "example.org",
  473. "port": "",
  474. "pathname": "/foo/:23",
  475. "search": "",
  476. "hash": ""
  477. },
  478. {
  479. "input": "/:23",
  480. "base": "http://example.org/foo/bar",
  481. "href": "http://example.org/:23",
  482. "origin": "http://example.org",
  483. "protocol": "http:",
  484. "username": "",
  485. "password": "",
  486. "host": "example.org",
  487. "hostname": "example.org",
  488. "port": "",
  489. "pathname": "/:23",
  490. "search": "",
  491. "hash": ""
  492. },
  493. {
  494. "input": "::",
  495. "base": "http://example.org/foo/bar",
  496. "href": "http://example.org/foo/::",
  497. "origin": "http://example.org",
  498. "protocol": "http:",
  499. "username": "",
  500. "password": "",
  501. "host": "example.org",
  502. "hostname": "example.org",
  503. "port": "",
  504. "pathname": "/foo/::",
  505. "search": "",
  506. "hash": ""
  507. },
  508. {
  509. "input": "::23",
  510. "base": "http://example.org/foo/bar",
  511. "href": "http://example.org/foo/::23",
  512. "origin": "http://example.org",
  513. "protocol": "http:",
  514. "username": "",
  515. "password": "",
  516. "host": "example.org",
  517. "hostname": "example.org",
  518. "port": "",
  519. "pathname": "/foo/::23",
  520. "search": "",
  521. "hash": ""
  522. },
  523. {
  524. "input": "foo://",
  525. "base": "http://example.org/foo/bar",
  526. "href": "foo:///",
  527. "origin": "null",
  528. "protocol": "foo:",
  529. "username": "",
  530. "password": "",
  531. "host": "",
  532. "hostname": "",
  533. "port": "",
  534. "pathname": "/",
  535. "search": "",
  536. "hash": ""
  537. },
  538. {
  539. "input": "http://a:b@c:29/d",
  540. "base": "http://example.org/foo/bar",
  541. "href": "http://a:b@c:29/d",
  542. "origin": "http://c:29",
  543. "protocol": "http:",
  544. "username": "a",
  545. "password": "b",
  546. "host": "c:29",
  547. "hostname": "c",
  548. "port": "29",
  549. "pathname": "/d",
  550. "search": "",
  551. "hash": ""
  552. },
  553. {
  554. "input": "http::@c:29",
  555. "base": "http://example.org/foo/bar",
  556. "href": "http://example.org/foo/:@c:29",
  557. "origin": "http://example.org",
  558. "protocol": "http:",
  559. "username": "",
  560. "password": "",
  561. "host": "example.org",
  562. "hostname": "example.org",
  563. "port": "",
  564. "pathname": "/foo/:@c:29",
  565. "search": "",
  566. "hash": ""
  567. },
  568. {
  569. "input": "http://&a:foo(b]c@d:2/",
  570. "base": "http://example.org/foo/bar",
  571. "href": "http://&a:foo(b%5Dc@d:2/",
  572. "origin": "http://d:2",
  573. "protocol": "http:",
  574. "username": "&a",
  575. "password": "foo(b%5Dc",
  576. "host": "d:2",
  577. "hostname": "d",
  578. "port": "2",
  579. "pathname": "/",
  580. "search": "",
  581. "hash": ""
  582. },
  583. {
  584. "input": "http://::@c@d:2",
  585. "base": "http://example.org/foo/bar",
  586. "href": "http://:%3A%40c@d:2/",
  587. "origin": "http://d:2",
  588. "protocol": "http:",
  589. "username": "",
  590. "password": "%3A%40c",
  591. "host": "d:2",
  592. "hostname": "d",
  593. "port": "2",
  594. "pathname": "/",
  595. "search": "",
  596. "hash": ""
  597. },
  598. {
  599. "input": "http://foo.com:b@d/",
  600. "base": "http://example.org/foo/bar",
  601. "href": "http://foo.com:b@d/",
  602. "origin": "http://d",
  603. "protocol": "http:",
  604. "username": "foo.com",
  605. "password": "b",
  606. "host": "d",
  607. "hostname": "d",
  608. "port": "",
  609. "pathname": "/",
  610. "search": "",
  611. "hash": ""
  612. },
  613. {
  614. "input": "http://foo.com/\\@",
  615. "base": "http://example.org/foo/bar",
  616. "href": "http://foo.com//@",
  617. "origin": "http://foo.com",
  618. "protocol": "http:",
  619. "username": "",
  620. "password": "",
  621. "host": "foo.com",
  622. "hostname": "foo.com",
  623. "port": "",
  624. "pathname": "//@",
  625. "search": "",
  626. "hash": ""
  627. },
  628. {
  629. "input": "http:\\\\foo.com\\",
  630. "base": "http://example.org/foo/bar",
  631. "href": "http://foo.com/",
  632. "origin": "http://foo.com",
  633. "protocol": "http:",
  634. "username": "",
  635. "password": "",
  636. "host": "foo.com",
  637. "hostname": "foo.com",
  638. "port": "",
  639. "pathname": "/",
  640. "search": "",
  641. "hash": ""
  642. },
  643. {
  644. "input": "http:\\\\a\\b:c\\d@foo.com\\",
  645. "base": "http://example.org/foo/bar",
  646. "href": "http://a/b:c/d@foo.com/",
  647. "origin": "http://a",
  648. "protocol": "http:",
  649. "username": "",
  650. "password": "",
  651. "host": "a",
  652. "hostname": "a",
  653. "port": "",
  654. "pathname": "/b:c/d@foo.com/",
  655. "search": "",
  656. "hash": ""
  657. },
  658. {
  659. "input": "foo:/",
  660. "base": "http://example.org/foo/bar",
  661. "href": "foo:/",
  662. "origin": "null",
  663. "protocol": "foo:",
  664. "username": "",
  665. "password": "",
  666. "host": "",
  667. "hostname": "",
  668. "port": "",
  669. "pathname": "/",
  670. "search": "",
  671. "hash": ""
  672. },
  673. {
  674. "input": "foo:/bar.com/",
  675. "base": "http://example.org/foo/bar",
  676. "href": "foo:/bar.com/",
  677. "origin": "null",
  678. "protocol": "foo:",
  679. "username": "",
  680. "password": "",
  681. "host": "",
  682. "hostname": "",
  683. "port": "",
  684. "pathname": "/bar.com/",
  685. "search": "",
  686. "hash": ""
  687. },
  688. {
  689. "input": "foo://///////",
  690. "base": "http://example.org/foo/bar",
  691. "href": "foo://///////",
  692. "origin": "null",
  693. "protocol": "foo:",
  694. "username": "",
  695. "password": "",
  696. "host": "",
  697. "hostname": "",
  698. "port": "",
  699. "pathname": "///////",
  700. "search": "",
  701. "hash": ""
  702. },
  703. {
  704. "input": "foo://///////bar.com/",
  705. "base": "http://example.org/foo/bar",
  706. "href": "foo://///////bar.com/",
  707. "origin": "null",
  708. "protocol": "foo:",
  709. "username": "",
  710. "password": "",
  711. "host": "",
  712. "hostname": "",
  713. "port": "",
  714. "pathname": "///////bar.com/",
  715. "search": "",
  716. "hash": ""
  717. },
  718. {
  719. "input": "foo:////://///",
  720. "base": "http://example.org/foo/bar",
  721. "href": "foo:////://///",
  722. "origin": "null",
  723. "protocol": "foo:",
  724. "username": "",
  725. "password": "",
  726. "host": "",
  727. "hostname": "",
  728. "port": "",
  729. "pathname": "//://///",
  730. "search": "",
  731. "hash": ""
  732. },
  733. {
  734. "input": "c:/foo",
  735. "base": "http://example.org/foo/bar",
  736. "href": "c:/foo",
  737. "origin": "null",
  738. "protocol": "c:",
  739. "username": "",
  740. "password": "",
  741. "host": "",
  742. "hostname": "",
  743. "port": "",
  744. "pathname": "/foo",
  745. "search": "",
  746. "hash": ""
  747. },
  748. {
  749. "input": "//foo/bar",
  750. "base": "http://example.org/foo/bar",
  751. "href": "http://foo/bar",
  752. "origin": "http://foo",
  753. "protocol": "http:",
  754. "username": "",
  755. "password": "",
  756. "host": "foo",
  757. "hostname": "foo",
  758. "port": "",
  759. "pathname": "/bar",
  760. "search": "",
  761. "hash": ""
  762. },
  763. {
  764. "input": "http://foo/path;a??e#f#g",
  765. "base": "http://example.org/foo/bar",
  766. "href": "http://foo/path;a??e#f#g",
  767. "origin": "http://foo",
  768. "protocol": "http:",
  769. "username": "",
  770. "password": "",
  771. "host": "foo",
  772. "hostname": "foo",
  773. "port": "",
  774. "pathname": "/path;a",
  775. "search": "??e",
  776. "hash": "#f#g"
  777. },
  778. {
  779. "input": "http://foo/abcd?efgh?ijkl",
  780. "base": "http://example.org/foo/bar",
  781. "href": "http://foo/abcd?efgh?ijkl",
  782. "origin": "http://foo",
  783. "protocol": "http:",
  784. "username": "",
  785. "password": "",
  786. "host": "foo",
  787. "hostname": "foo",
  788. "port": "",
  789. "pathname": "/abcd",
  790. "search": "?efgh?ijkl",
  791. "hash": ""
  792. },
  793. {
  794. "input": "http://foo/abcd#foo?bar",
  795. "base": "http://example.org/foo/bar",
  796. "href": "http://foo/abcd#foo?bar",
  797. "origin": "http://foo",
  798. "protocol": "http:",
  799. "username": "",
  800. "password": "",
  801. "host": "foo",
  802. "hostname": "foo",
  803. "port": "",
  804. "pathname": "/abcd",
  805. "search": "",
  806. "hash": "#foo?bar"
  807. },
  808. {
  809. "input": "[61:24:74]:98",
  810. "base": "http://example.org/foo/bar",
  811. "href": "http://example.org/foo/[61:24:74]:98",
  812. "origin": "http://example.org",
  813. "protocol": "http:",
  814. "username": "",
  815. "password": "",
  816. "host": "example.org",
  817. "hostname": "example.org",
  818. "port": "",
  819. "pathname": "/foo/[61:24:74]:98",
  820. "search": "",
  821. "hash": ""
  822. },
  823. {
  824. "input": "http:[61:27]/:foo",
  825. "base": "http://example.org/foo/bar",
  826. "href": "http://example.org/foo/[61:27]/:foo",
  827. "origin": "http://example.org",
  828. "protocol": "http:",
  829. "username": "",
  830. "password": "",
  831. "host": "example.org",
  832. "hostname": "example.org",
  833. "port": "",
  834. "pathname": "/foo/[61:27]/:foo",
  835. "search": "",
  836. "hash": ""
  837. },
  838. {
  839. "input": "http://[1::2]:3:4",
  840. "base": "http://example.org/foo/bar",
  841. "failure": true
  842. },
  843. {
  844. "input": "http://2001::1",
  845. "base": "http://example.org/foo/bar",
  846. "failure": true
  847. },
  848. {
  849. "input": "http://2001::1]",
  850. "base": "http://example.org/foo/bar",
  851. "failure": true
  852. },
  853. {
  854. "input": "http://2001::1]:80",
  855. "base": "http://example.org/foo/bar",
  856. "failure": true
  857. },
  858. {
  859. "input": "http://[2001::1]",
  860. "base": "http://example.org/foo/bar",
  861. "href": "http://[2001::1]/",
  862. "origin": "http://[2001::1]",
  863. "protocol": "http:",
  864. "username": "",
  865. "password": "",
  866. "host": "[2001::1]",
  867. "hostname": "[2001::1]",
  868. "port": "",
  869. "pathname": "/",
  870. "search": "",
  871. "hash": ""
  872. },
  873. {
  874. "input": "http://[::127.0.0.1]",
  875. "base": "http://example.org/foo/bar",
  876. "href": "http://[::7f00:1]/",
  877. "origin": "http://[::7f00:1]",
  878. "protocol": "http:",
  879. "username": "",
  880. "password": "",
  881. "host": "[::7f00:1]",
  882. "hostname": "[::7f00:1]",
  883. "port": "",
  884. "pathname": "/",
  885. "search": "",
  886. "hash": ""
  887. },
  888. {
  889. "input": "http://[0:0:0:0:0:0:13.1.68.3]",
  890. "base": "http://example.org/foo/bar",
  891. "href": "http://[::d01:4403]/",
  892. "origin": "http://[::d01:4403]",
  893. "protocol": "http:",
  894. "username": "",
  895. "password": "",
  896. "host": "[::d01:4403]",
  897. "hostname": "[::d01:4403]",
  898. "port": "",
  899. "pathname": "/",
  900. "search": "",
  901. "hash": ""
  902. },
  903. {
  904. "input": "http://[2001::1]:80",
  905. "base": "http://example.org/foo/bar",
  906. "href": "http://[2001::1]/",
  907. "origin": "http://[2001::1]",
  908. "protocol": "http:",
  909. "username": "",
  910. "password": "",
  911. "host": "[2001::1]",
  912. "hostname": "[2001::1]",
  913. "port": "",
  914. "pathname": "/",
  915. "search": "",
  916. "hash": ""
  917. },
  918. {
  919. "input": "http:/example.com/",
  920. "base": "http://example.org/foo/bar",
  921. "href": "http://example.org/example.com/",
  922. "origin": "http://example.org",
  923. "protocol": "http:",
  924. "username": "",
  925. "password": "",
  926. "host": "example.org",
  927. "hostname": "example.org",
  928. "port": "",
  929. "pathname": "/example.com/",
  930. "search": "",
  931. "hash": ""
  932. },
  933. {
  934. "input": "ftp:/example.com/",
  935. "base": "http://example.org/foo/bar",
  936. "href": "ftp://example.com/",
  937. "origin": "ftp://example.com",
  938. "protocol": "ftp:",
  939. "username": "",
  940. "password": "",
  941. "host": "example.com",
  942. "hostname": "example.com",
  943. "port": "",
  944. "pathname": "/",
  945. "search": "",
  946. "hash": ""
  947. },
  948. {
  949. "input": "https:/example.com/",
  950. "base": "http://example.org/foo/bar",
  951. "href": "https://example.com/",
  952. "origin": "https://example.com",
  953. "protocol": "https:",
  954. "username": "",
  955. "password": "",
  956. "host": "example.com",
  957. "hostname": "example.com",
  958. "port": "",
  959. "pathname": "/",
  960. "search": "",
  961. "hash": ""
  962. },
  963. {
  964. "input": "madeupscheme:/example.com/",
  965. "base": "http://example.org/foo/bar",
  966. "href": "madeupscheme:/example.com/",
  967. "origin": "null",
  968. "protocol": "madeupscheme:",
  969. "username": "",
  970. "password": "",
  971. "host": "",
  972. "hostname": "",
  973. "port": "",
  974. "pathname": "/example.com/",
  975. "search": "",
  976. "hash": ""
  977. },
  978. {
  979. "input": "file:/example.com/",
  980. "base": "http://example.org/foo/bar",
  981. "href": "file:///example.com/",
  982. "protocol": "file:",
  983. "username": "",
  984. "password": "",
  985. "host": "",
  986. "hostname": "",
  987. "port": "",
  988. "pathname": "/example.com/",
  989. "search": "",
  990. "hash": ""
  991. },
  992. {
  993. "input": "ftps:/example.com/",
  994. "base": "http://example.org/foo/bar",
  995. "href": "ftps:/example.com/",
  996. "origin": "null",
  997. "protocol": "ftps:",
  998. "username": "",
  999. "password": "",
  1000. "host": "",
  1001. "hostname": "",
  1002. "port": "",
  1003. "pathname": "/example.com/",
  1004. "search": "",
  1005. "hash": ""
  1006. },
  1007. {
  1008. "input": "gopher:/example.com/",
  1009. "base": "http://example.org/foo/bar",
  1010. "href": "gopher://example.com/",
  1011. "origin": "gopher://example.com",
  1012. "protocol": "gopher:",
  1013. "username": "",
  1014. "password": "",
  1015. "host": "example.com",
  1016. "hostname": "example.com",
  1017. "port": "",
  1018. "pathname": "/",
  1019. "search": "",
  1020. "hash": ""
  1021. },
  1022. {
  1023. "input": "ws:/example.com/",
  1024. "base": "http://example.org/foo/bar",
  1025. "href": "ws://example.com/",
  1026. "origin": "ws://example.com",
  1027. "protocol": "ws:",
  1028. "username": "",
  1029. "password": "",
  1030. "host": "example.com",
  1031. "hostname": "example.com",
  1032. "port": "",
  1033. "pathname": "/",
  1034. "search": "",
  1035. "hash": ""
  1036. },
  1037. {
  1038. "input": "wss:/example.com/",
  1039. "base": "http://example.org/foo/bar",
  1040. "href": "wss://example.com/",
  1041. "origin": "wss://example.com",
  1042. "protocol": "wss:",
  1043. "username": "",
  1044. "password": "",
  1045. "host": "example.com",
  1046. "hostname": "example.com",
  1047. "port": "",
  1048. "pathname": "/",
  1049. "search": "",
  1050. "hash": ""
  1051. },
  1052. {
  1053. "input": "data:/example.com/",
  1054. "base": "http://example.org/foo/bar",
  1055. "href": "data:/example.com/",
  1056. "origin": "null",
  1057. "protocol": "data:",
  1058. "username": "",
  1059. "password": "",
  1060. "host": "",
  1061. "hostname": "",
  1062. "port": "",
  1063. "pathname": "/example.com/",
  1064. "search": "",
  1065. "hash": ""
  1066. },
  1067. {
  1068. "input": "javascript:/example.com/",
  1069. "base": "http://example.org/foo/bar",
  1070. "href": "javascript:/example.com/",
  1071. "origin": "null",
  1072. "protocol": "javascript:",
  1073. "username": "",
  1074. "password": "",
  1075. "host": "",
  1076. "hostname": "",
  1077. "port": "",
  1078. "pathname": "/example.com/",
  1079. "search": "",
  1080. "hash": ""
  1081. },
  1082. {
  1083. "input": "mailto:/example.com/",
  1084. "base": "http://example.org/foo/bar",
  1085. "href": "mailto:/example.com/",
  1086. "origin": "null",
  1087. "protocol": "mailto:",
  1088. "username": "",
  1089. "password": "",
  1090. "host": "",
  1091. "hostname": "",
  1092. "port": "",
  1093. "pathname": "/example.com/",
  1094. "search": "",
  1095. "hash": ""
  1096. },
  1097. {
  1098. "input": "http:example.com/",
  1099. "base": "http://example.org/foo/bar",
  1100. "href": "http://example.org/foo/example.com/",
  1101. "origin": "http://example.org",
  1102. "protocol": "http:",
  1103. "username": "",
  1104. "password": "",
  1105. "host": "example.org",
  1106. "hostname": "example.org",
  1107. "port": "",
  1108. "pathname": "/foo/example.com/",
  1109. "search": "",
  1110. "hash": ""
  1111. },
  1112. {
  1113. "input": "ftp:example.com/",
  1114. "base": "http://example.org/foo/bar",
  1115. "href": "ftp://example.com/",
  1116. "origin": "ftp://example.com",
  1117. "protocol": "ftp:",
  1118. "username": "",
  1119. "password": "",
  1120. "host": "example.com",
  1121. "hostname": "example.com",
  1122. "port": "",
  1123. "pathname": "/",
  1124. "search": "",
  1125. "hash": ""
  1126. },
  1127. {
  1128. "input": "https:example.com/",
  1129. "base": "http://example.org/foo/bar",
  1130. "href": "https://example.com/",
  1131. "origin": "https://example.com",
  1132. "protocol": "https:",
  1133. "username": "",
  1134. "password": "",
  1135. "host": "example.com",
  1136. "hostname": "example.com",
  1137. "port": "",
  1138. "pathname": "/",
  1139. "search": "",
  1140. "hash": ""
  1141. },
  1142. {
  1143. "input": "madeupscheme:example.com/",
  1144. "base": "http://example.org/foo/bar",
  1145. "href": "madeupscheme:example.com/",
  1146. "origin": "null",
  1147. "protocol": "madeupscheme:",
  1148. "username": "",
  1149. "password": "",
  1150. "host": "",
  1151. "hostname": "",
  1152. "port": "",
  1153. "pathname": "example.com/",
  1154. "search": "",
  1155. "hash": ""
  1156. },
  1157. {
  1158. "input": "ftps:example.com/",
  1159. "base": "http://example.org/foo/bar",
  1160. "href": "ftps:example.com/",
  1161. "origin": "null",
  1162. "protocol": "ftps:",
  1163. "username": "",
  1164. "password": "",
  1165. "host": "",
  1166. "hostname": "",
  1167. "port": "",
  1168. "pathname": "example.com/",
  1169. "search": "",
  1170. "hash": ""
  1171. },
  1172. {
  1173. "input": "gopher:example.com/",
  1174. "base": "http://example.org/foo/bar",
  1175. "href": "gopher://example.com/",
  1176. "origin": "gopher://example.com",
  1177. "protocol": "gopher:",
  1178. "username": "",
  1179. "password": "",
  1180. "host": "example.com",
  1181. "hostname": "example.com",
  1182. "port": "",
  1183. "pathname": "/",
  1184. "search": "",
  1185. "hash": ""
  1186. },
  1187. {
  1188. "input": "ws:example.com/",
  1189. "base": "http://example.org/foo/bar",
  1190. "href": "ws://example.com/",
  1191. "origin": "ws://example.com",
  1192. "protocol": "ws:",
  1193. "username": "",
  1194. "password": "",
  1195. "host": "example.com",
  1196. "hostname": "example.com",
  1197. "port": "",
  1198. "pathname": "/",
  1199. "search": "",
  1200. "hash": ""
  1201. },
  1202. {
  1203. "input": "wss:example.com/",
  1204. "base": "http://example.org/foo/bar",
  1205. "href": "wss://example.com/",
  1206. "origin": "wss://example.com",
  1207. "protocol": "wss:",
  1208. "username": "",
  1209. "password": "",
  1210. "host": "example.com",
  1211. "hostname": "example.com",
  1212. "port": "",
  1213. "pathname": "/",
  1214. "search": "",
  1215. "hash": ""
  1216. },
  1217. {
  1218. "input": "data:example.com/",
  1219. "base": "http://example.org/foo/bar",
  1220. "href": "data:example.com/",
  1221. "origin": "null",
  1222. "protocol": "data:",
  1223. "username": "",
  1224. "password": "",
  1225. "host": "",
  1226. "hostname": "",
  1227. "port": "",
  1228. "pathname": "example.com/",
  1229. "search": "",
  1230. "hash": ""
  1231. },
  1232. {
  1233. "input": "javascript:example.com/",
  1234. "base": "http://example.org/foo/bar",
  1235. "href": "javascript:example.com/",
  1236. "origin": "null",
  1237. "protocol": "javascript:",
  1238. "username": "",
  1239. "password": "",
  1240. "host": "",
  1241. "hostname": "",
  1242. "port": "",
  1243. "pathname": "example.com/",
  1244. "search": "",
  1245. "hash": ""
  1246. },
  1247. {
  1248. "input": "mailto:example.com/",
  1249. "base": "http://example.org/foo/bar",
  1250. "href": "mailto:example.com/",
  1251. "origin": "null",
  1252. "protocol": "mailto:",
  1253. "username": "",
  1254. "password": "",
  1255. "host": "",
  1256. "hostname": "",
  1257. "port": "",
  1258. "pathname": "example.com/",
  1259. "search": "",
  1260. "hash": ""
  1261. },
  1262. {
  1263. "input": "/a/b/c",
  1264. "base": "http://example.org/foo/bar",
  1265. "href": "http://example.org/a/b/c",
  1266. "origin": "http://example.org",
  1267. "protocol": "http:",
  1268. "username": "",
  1269. "password": "",
  1270. "host": "example.org",
  1271. "hostname": "example.org",
  1272. "port": "",
  1273. "pathname": "/a/b/c",
  1274. "search": "",
  1275. "hash": ""
  1276. },
  1277. {
  1278. "input": "/a/ /c",
  1279. "base": "http://example.org/foo/bar",
  1280. "href": "http://example.org/a/%20/c",
  1281. "origin": "http://example.org",
  1282. "protocol": "http:",
  1283. "username": "",
  1284. "password": "",
  1285. "host": "example.org",
  1286. "hostname": "example.org",
  1287. "port": "",
  1288. "pathname": "/a/%20/c",
  1289. "search": "",
  1290. "hash": ""
  1291. },
  1292. {
  1293. "input": "/a%2fc",
  1294. "base": "http://example.org/foo/bar",
  1295. "href": "http://example.org/a%2fc",
  1296. "origin": "http://example.org",
  1297. "protocol": "http:",
  1298. "username": "",
  1299. "password": "",
  1300. "host": "example.org",
  1301. "hostname": "example.org",
  1302. "port": "",
  1303. "pathname": "/a%2fc",
  1304. "search": "",
  1305. "hash": ""
  1306. },
  1307. {
  1308. "input": "/a/%2f/c",
  1309. "base": "http://example.org/foo/bar",
  1310. "href": "http://example.org/a/%2f/c",
  1311. "origin": "http://example.org",
  1312. "protocol": "http:",
  1313. "username": "",
  1314. "password": "",
  1315. "host": "example.org",
  1316. "hostname": "example.org",
  1317. "port": "",
  1318. "pathname": "/a/%2f/c",
  1319. "search": "",
  1320. "hash": ""
  1321. },
  1322. {
  1323. "input": "#β",
  1324. "base": "http://example.org/foo/bar",
  1325. "href": "http://example.org/foo/bar#%CE%B2",
  1326. "origin": "http://example.org",
  1327. "protocol": "http:",
  1328. "username": "",
  1329. "password": "",
  1330. "host": "example.org",
  1331. "hostname": "example.org",
  1332. "port": "",
  1333. "pathname": "/foo/bar",
  1334. "search": "",
  1335. "hash": "#%CE%B2"
  1336. },
  1337. {
  1338. "input": "data:text/html,test#test",
  1339. "base": "http://example.org/foo/bar",
  1340. "href": "data:text/html,test#test",
  1341. "origin": "null",
  1342. "protocol": "data:",
  1343. "username": "",
  1344. "password": "",
  1345. "host": "",
  1346. "hostname": "",
  1347. "port": "",
  1348. "pathname": "text/html,test",
  1349. "search": "",
  1350. "hash": "#test"
  1351. },
  1352. {
  1353. "input": "tel:1234567890",
  1354. "base": "http://example.org/foo/bar",
  1355. "href": "tel:1234567890",
  1356. "origin": "null",
  1357. "protocol": "tel:",
  1358. "username": "",
  1359. "password": "",
  1360. "host": "",
  1361. "hostname": "",
  1362. "port": "",
  1363. "pathname": "1234567890",
  1364. "search": "",
  1365. "hash": ""
  1366. },
  1367. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
  1368. {
  1369. "input": "file:c:\\foo\\bar.html",
  1370. "base": "file:///tmp/mock/path",
  1371. "href": "file:///c:/foo/bar.html",
  1372. "protocol": "file:",
  1373. "username": "",
  1374. "password": "",
  1375. "host": "",
  1376. "hostname": "",
  1377. "port": "",
  1378. "pathname": "/c:/foo/bar.html",
  1379. "search": "",
  1380. "hash": ""
  1381. },
  1382. {
  1383. "input": " File:c|////foo\\bar.html",
  1384. "base": "file:///tmp/mock/path",
  1385. "href": "file:///c:////foo/bar.html",
  1386. "protocol": "file:",
  1387. "username": "",
  1388. "password": "",
  1389. "host": "",
  1390. "hostname": "",
  1391. "port": "",
  1392. "pathname": "/c:////foo/bar.html",
  1393. "search": "",
  1394. "hash": ""
  1395. },
  1396. {
  1397. "input": "C|/foo/bar",
  1398. "base": "file:///tmp/mock/path",
  1399. "href": "file:///C:/foo/bar",
  1400. "protocol": "file:",
  1401. "username": "",
  1402. "password": "",
  1403. "host": "",
  1404. "hostname": "",
  1405. "port": "",
  1406. "pathname": "/C:/foo/bar",
  1407. "search": "",
  1408. "hash": ""
  1409. },
  1410. {
  1411. "input": "/C|\\foo\\bar",
  1412. "base": "file:///tmp/mock/path",
  1413. "href": "file:///C:/foo/bar",
  1414. "protocol": "file:",
  1415. "username": "",
  1416. "password": "",
  1417. "host": "",
  1418. "hostname": "",
  1419. "port": "",
  1420. "pathname": "/C:/foo/bar",
  1421. "search": "",
  1422. "hash": ""
  1423. },
  1424. {
  1425. "input": "//C|/foo/bar",
  1426. "base": "file:///tmp/mock/path",
  1427. "href": "file:///C:/foo/bar",
  1428. "protocol": "file:",
  1429. "username": "",
  1430. "password": "",
  1431. "host": "",
  1432. "hostname": "",
  1433. "port": "",
  1434. "pathname": "/C:/foo/bar",
  1435. "search": "",
  1436. "hash": ""
  1437. },
  1438. {
  1439. "input": "//server/file",
  1440. "base": "file:///tmp/mock/path",
  1441. "href": "file://server/file",
  1442. "protocol": "file:",
  1443. "username": "",
  1444. "password": "",
  1445. "host": "server",
  1446. "hostname": "server",
  1447. "port": "",
  1448. "pathname": "/file",
  1449. "search": "",
  1450. "hash": ""
  1451. },
  1452. {
  1453. "input": "\\\\server\\file",
  1454. "base": "file:///tmp/mock/path",
  1455. "href": "file://server/file",
  1456. "protocol": "file:",
  1457. "username": "",
  1458. "password": "",
  1459. "host": "server",
  1460. "hostname": "server",
  1461. "port": "",
  1462. "pathname": "/file",
  1463. "search": "",
  1464. "hash": ""
  1465. },
  1466. {
  1467. "input": "/\\server/file",
  1468. "base": "file:///tmp/mock/path",
  1469. "href": "file://server/file",
  1470. "protocol": "file:",
  1471. "username": "",
  1472. "password": "",
  1473. "host": "server",
  1474. "hostname": "server",
  1475. "port": "",
  1476. "pathname": "/file",
  1477. "search": "",
  1478. "hash": ""
  1479. },
  1480. {
  1481. "input": "file:///foo/bar.txt",
  1482. "base": "file:///tmp/mock/path",
  1483. "href": "file:///foo/bar.txt",
  1484. "protocol": "file:",
  1485. "username": "",
  1486. "password": "",
  1487. "host": "",
  1488. "hostname": "",
  1489. "port": "",
  1490. "pathname": "/foo/bar.txt",
  1491. "search": "",
  1492. "hash": ""
  1493. },
  1494. {
  1495. "input": "file:///home/me",
  1496. "base": "file:///tmp/mock/path",
  1497. "href": "file:///home/me",
  1498. "protocol": "file:",
  1499. "username": "",
  1500. "password": "",
  1501. "host": "",
  1502. "hostname": "",
  1503. "port": "",
  1504. "pathname": "/home/me",
  1505. "search": "",
  1506. "hash": ""
  1507. },
  1508. {
  1509. "input": "//",
  1510. "base": "file:///tmp/mock/path",
  1511. "href": "file:///",
  1512. "protocol": "file:",
  1513. "username": "",
  1514. "password": "",
  1515. "host": "",
  1516. "hostname": "",
  1517. "port": "",
  1518. "pathname": "/",
  1519. "search": "",
  1520. "hash": ""
  1521. },
  1522. {
  1523. "input": "///",
  1524. "base": "file:///tmp/mock/path",
  1525. "href": "file:///",
  1526. "protocol": "file:",
  1527. "username": "",
  1528. "password": "",
  1529. "host": "",
  1530. "hostname": "",
  1531. "port": "",
  1532. "pathname": "/",
  1533. "search": "",
  1534. "hash": ""
  1535. },
  1536. {
  1537. "input": "///test",
  1538. "base": "file:///tmp/mock/path",
  1539. "href": "file:///test",
  1540. "protocol": "file:",
  1541. "username": "",
  1542. "password": "",
  1543. "host": "",
  1544. "hostname": "",
  1545. "port": "",
  1546. "pathname": "/test",
  1547. "search": "",
  1548. "hash": ""
  1549. },
  1550. {
  1551. "input": "file://test",
  1552. "base": "file:///tmp/mock/path",
  1553. "href": "file://test/",
  1554. "protocol": "file:",
  1555. "username": "",
  1556. "password": "",
  1557. "host": "test",
  1558. "hostname": "test",
  1559. "port": "",
  1560. "pathname": "/",
  1561. "search": "",
  1562. "hash": ""
  1563. },
  1564. {
  1565. "input": "file://localhost",
  1566. "base": "file:///tmp/mock/path",
  1567. "href": "file:///",
  1568. "protocol": "file:",
  1569. "username": "",
  1570. "password": "",
  1571. "host": "",
  1572. "hostname": "",
  1573. "port": "",
  1574. "pathname": "/",
  1575. "search": "",
  1576. "hash": ""
  1577. },
  1578. {
  1579. "input": "file://localhost/",
  1580. "base": "file:///tmp/mock/path",
  1581. "href": "file:///",
  1582. "protocol": "file:",
  1583. "username": "",
  1584. "password": "",
  1585. "host": "",
  1586. "hostname": "",
  1587. "port": "",
  1588. "pathname": "/",
  1589. "search": "",
  1590. "hash": ""
  1591. },
  1592. {
  1593. "input": "file://localhost/test",
  1594. "base": "file:///tmp/mock/path",
  1595. "href": "file:///test",
  1596. "protocol": "file:",
  1597. "username": "",
  1598. "password": "",
  1599. "host": "",
  1600. "hostname": "",
  1601. "port": "",
  1602. "pathname": "/test",
  1603. "search": "",
  1604. "hash": ""
  1605. },
  1606. {
  1607. "input": "test",
  1608. "base": "file:///tmp/mock/path",
  1609. "href": "file:///tmp/mock/test",
  1610. "protocol": "file:",
  1611. "username": "",
  1612. "password": "",
  1613. "host": "",
  1614. "hostname": "",
  1615. "port": "",
  1616. "pathname": "/tmp/mock/test",
  1617. "search": "",
  1618. "hash": ""
  1619. },
  1620. {
  1621. "input": "file:test",
  1622. "base": "file:///tmp/mock/path",
  1623. "href": "file:///tmp/mock/test",
  1624. "protocol": "file:",
  1625. "username": "",
  1626. "password": "",
  1627. "host": "",
  1628. "hostname": "",
  1629. "port": "",
  1630. "pathname": "/tmp/mock/test",
  1631. "search": "",
  1632. "hash": ""
  1633. },
  1634. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
  1635. {
  1636. "input": "http://example.com/././foo",
  1637. "base": "about:blank",
  1638. "href": "http://example.com/foo",
  1639. "origin": "http://example.com",
  1640. "protocol": "http:",
  1641. "username": "",
  1642. "password": "",
  1643. "host": "example.com",
  1644. "hostname": "example.com",
  1645. "port": "",
  1646. "pathname": "/foo",
  1647. "search": "",
  1648. "hash": ""
  1649. },
  1650. {
  1651. "input": "http://example.com/./.foo",
  1652. "base": "about:blank",
  1653. "href": "http://example.com/.foo",
  1654. "origin": "http://example.com",
  1655. "protocol": "http:",
  1656. "username": "",
  1657. "password": "",
  1658. "host": "example.com",
  1659. "hostname": "example.com",
  1660. "port": "",
  1661. "pathname": "/.foo",
  1662. "search": "",
  1663. "hash": ""
  1664. },
  1665. {
  1666. "input": "http://example.com/foo/.",
  1667. "base": "about:blank",
  1668. "href": "http://example.com/foo/",
  1669. "origin": "http://example.com",
  1670. "protocol": "http:",
  1671. "username": "",
  1672. "password": "",
  1673. "host": "example.com",
  1674. "hostname": "example.com",
  1675. "port": "",
  1676. "pathname": "/foo/",
  1677. "search": "",
  1678. "hash": ""
  1679. },
  1680. {
  1681. "input": "http://example.com/foo/./",
  1682. "base": "about:blank",
  1683. "href": "http://example.com/foo/",
  1684. "origin": "http://example.com",
  1685. "protocol": "http:",
  1686. "username": "",
  1687. "password": "",
  1688. "host": "example.com",
  1689. "hostname": "example.com",
  1690. "port": "",
  1691. "pathname": "/foo/",
  1692. "search": "",
  1693. "hash": ""
  1694. },
  1695. {
  1696. "input": "http://example.com/foo/bar/..",
  1697. "base": "about:blank",
  1698. "href": "http://example.com/foo/",
  1699. "origin": "http://example.com",
  1700. "protocol": "http:",
  1701. "username": "",
  1702. "password": "",
  1703. "host": "example.com",
  1704. "hostname": "example.com",
  1705. "port": "",
  1706. "pathname": "/foo/",
  1707. "search": "",
  1708. "hash": ""
  1709. },
  1710. {
  1711. "input": "http://example.com/foo/bar/../",
  1712. "base": "about:blank",
  1713. "href": "http://example.com/foo/",
  1714. "origin": "http://example.com",
  1715. "protocol": "http:",
  1716. "username": "",
  1717. "password": "",
  1718. "host": "example.com",
  1719. "hostname": "example.com",
  1720. "port": "",
  1721. "pathname": "/foo/",
  1722. "search": "",
  1723. "hash": ""
  1724. },
  1725. {
  1726. "input": "http://example.com/foo/..bar",
  1727. "base": "about:blank",
  1728. "href": "http://example.com/foo/..bar",
  1729. "origin": "http://example.com",
  1730. "protocol": "http:",
  1731. "username": "",
  1732. "password": "",
  1733. "host": "example.com",
  1734. "hostname": "example.com",
  1735. "port": "",
  1736. "pathname": "/foo/..bar",
  1737. "search": "",
  1738. "hash": ""
  1739. },
  1740. {
  1741. "input": "http://example.com/foo/bar/../ton",
  1742. "base": "about:blank",
  1743. "href": "http://example.com/foo/ton",
  1744. "origin": "http://example.com",
  1745. "protocol": "http:",
  1746. "username": "",
  1747. "password": "",
  1748. "host": "example.com",
  1749. "hostname": "example.com",
  1750. "port": "",
  1751. "pathname": "/foo/ton",
  1752. "search": "",
  1753. "hash": ""
  1754. },
  1755. {
  1756. "input": "http://example.com/foo/bar/../ton/../../a",
  1757. "base": "about:blank",
  1758. "href": "http://example.com/a",
  1759. "origin": "http://example.com",
  1760. "protocol": "http:",
  1761. "username": "",
  1762. "password": "",
  1763. "host": "example.com",
  1764. "hostname": "example.com",
  1765. "port": "",
  1766. "pathname": "/a",
  1767. "search": "",
  1768. "hash": ""
  1769. },
  1770. {
  1771. "input": "http://example.com/foo/../../..",
  1772. "base": "about:blank",
  1773. "href": "http://example.com/",
  1774. "origin": "http://example.com",
  1775. "protocol": "http:",
  1776. "username": "",
  1777. "password": "",
  1778. "host": "example.com",
  1779. "hostname": "example.com",
  1780. "port": "",
  1781. "pathname": "/",
  1782. "search": "",
  1783. "hash": ""
  1784. },
  1785. {
  1786. "input": "http://example.com/foo/../../../ton",
  1787. "base": "about:blank",
  1788. "href": "http://example.com/ton",
  1789. "origin": "http://example.com",
  1790. "protocol": "http:",
  1791. "username": "",
  1792. "password": "",
  1793. "host": "example.com",
  1794. "hostname": "example.com",
  1795. "port": "",
  1796. "pathname": "/ton",
  1797. "search": "",
  1798. "hash": ""
  1799. },
  1800. {
  1801. "input": "http://example.com/foo/%2e",
  1802. "base": "about:blank",
  1803. "href": "http://example.com/foo/",
  1804. "origin": "http://example.com",
  1805. "protocol": "http:",
  1806. "username": "",
  1807. "password": "",
  1808. "host": "example.com",
  1809. "hostname": "example.com",
  1810. "port": "",
  1811. "pathname": "/foo/",
  1812. "search": "",
  1813. "hash": ""
  1814. },
  1815. {
  1816. "input": "http://example.com/foo/%2e%2",
  1817. "base": "about:blank",
  1818. "href": "http://example.com/foo/.%2",
  1819. "origin": "http://example.com",
  1820. "protocol": "http:",
  1821. "username": "",
  1822. "password": "",
  1823. "host": "example.com",
  1824. "hostname": "example.com",
  1825. "port": "",
  1826. "pathname": "/foo/.%2",
  1827. "search": "",
  1828. "hash": ""
  1829. },
  1830. {
  1831. "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
  1832. "base": "about:blank",
  1833. "href": "http://example.com/..bar",
  1834. "origin": "http://example.com",
  1835. "protocol": "http:",
  1836. "username": "",
  1837. "password": "",
  1838. "host": "example.com",
  1839. "hostname": "example.com",
  1840. "port": "",
  1841. "pathname": "/..bar",
  1842. "search": "",
  1843. "hash": ""
  1844. },
  1845. {
  1846. "input": "http://example.com////../..",
  1847. "base": "about:blank",
  1848. "href": "http://example.com//",
  1849. "origin": "http://example.com",
  1850. "protocol": "http:",
  1851. "username": "",
  1852. "password": "",
  1853. "host": "example.com",
  1854. "hostname": "example.com",
  1855. "port": "",
  1856. "pathname": "//",
  1857. "search": "",
  1858. "hash": ""
  1859. },
  1860. {
  1861. "input": "http://example.com/foo/bar//../..",
  1862. "base": "about:blank",
  1863. "href": "http://example.com/foo/",
  1864. "origin": "http://example.com",
  1865. "protocol": "http:",
  1866. "username": "",
  1867. "password": "",
  1868. "host": "example.com",
  1869. "hostname": "example.com",
  1870. "port": "",
  1871. "pathname": "/foo/",
  1872. "search": "",
  1873. "hash": ""
  1874. },
  1875. {
  1876. "input": "http://example.com/foo/bar//..",
  1877. "base": "about:blank",
  1878. "href": "http://example.com/foo/bar/",
  1879. "origin": "http://example.com",
  1880. "protocol": "http:",
  1881. "username": "",
  1882. "password": "",
  1883. "host": "example.com",
  1884. "hostname": "example.com",
  1885. "port": "",
  1886. "pathname": "/foo/bar/",
  1887. "search": "",
  1888. "hash": ""
  1889. },
  1890. {
  1891. "input": "http://example.com/foo",
  1892. "base": "about:blank",
  1893. "href": "http://example.com/foo",
  1894. "origin": "http://example.com",
  1895. "protocol": "http:",
  1896. "username": "",
  1897. "password": "",
  1898. "host": "example.com",
  1899. "hostname": "example.com",
  1900. "port": "",
  1901. "pathname": "/foo",
  1902. "search": "",
  1903. "hash": ""
  1904. },
  1905. {
  1906. "input": "http://example.com/%20foo",
  1907. "base": "about:blank",
  1908. "href": "http://example.com/%20foo",
  1909. "origin": "http://example.com",
  1910. "protocol": "http:",
  1911. "username": "",
  1912. "password": "",
  1913. "host": "example.com",
  1914. "hostname": "example.com",
  1915. "port": "",
  1916. "pathname": "/%20foo",
  1917. "search": "",
  1918. "hash": ""
  1919. },
  1920. {
  1921. "input": "http://example.com/foo%",
  1922. "base": "about:blank",
  1923. "href": "http://example.com/foo%",
  1924. "origin": "http://example.com",
  1925. "protocol": "http:",
  1926. "username": "",
  1927. "password": "",
  1928. "host": "example.com",
  1929. "hostname": "example.com",
  1930. "port": "",
  1931. "pathname": "/foo%",
  1932. "search": "",
  1933. "hash": ""
  1934. },
  1935. {
  1936. "input": "http://example.com/foo%2",
  1937. "base": "about:blank",
  1938. "href": "http://example.com/foo%2",
  1939. "origin": "http://example.com",
  1940. "protocol": "http:",
  1941. "username": "",
  1942. "password": "",
  1943. "host": "example.com",
  1944. "hostname": "example.com",
  1945. "port": "",
  1946. "pathname": "/foo%2",
  1947. "search": "",
  1948. "hash": ""
  1949. },
  1950. {
  1951. "input": "http://example.com/foo%2zbar",
  1952. "base": "about:blank",
  1953. "href": "http://example.com/foo%2zbar",
  1954. "origin": "http://example.com",
  1955. "protocol": "http:",
  1956. "username": "",
  1957. "password": "",
  1958. "host": "example.com",
  1959. "hostname": "example.com",
  1960. "port": "",
  1961. "pathname": "/foo%2zbar",
  1962. "search": "",
  1963. "hash": ""
  1964. },
  1965. {
  1966. "input": "http://example.com/foo%2©zbar",
  1967. "base": "about:blank",
  1968. "href": "http://example.com/foo%2%C3%82%C2%A9zbar",
  1969. "origin": "http://example.com",
  1970. "protocol": "http:",
  1971. "username": "",
  1972. "password": "",
  1973. "host": "example.com",
  1974. "hostname": "example.com",
  1975. "port": "",
  1976. "pathname": "/foo%2%C3%82%C2%A9zbar",
  1977. "search": "",
  1978. "hash": ""
  1979. },
  1980. {
  1981. "input": "http://example.com/foo%41%7a",
  1982. "base": "about:blank",
  1983. "href": "http://example.com/foo%41%7a",
  1984. "origin": "http://example.com",
  1985. "protocol": "http:",
  1986. "username": "",
  1987. "password": "",
  1988. "host": "example.com",
  1989. "hostname": "example.com",
  1990. "port": "",
  1991. "pathname": "/foo%41%7a",
  1992. "search": "",
  1993. "hash": ""
  1994. },
  1995. {
  1996. "input": "http://example.com/foo\t\u0091%91",
  1997. "base": "about:blank",
  1998. "href": "http://example.com/foo%C2%91%91",
  1999. "origin": "http://example.com",
  2000. "protocol": "http:",
  2001. "username": "",
  2002. "password": "",
  2003. "host": "example.com",
  2004. "hostname": "example.com",
  2005. "port": "",
  2006. "pathname": "/foo%C2%91%91",
  2007. "search": "",
  2008. "hash": ""
  2009. },
  2010. {
  2011. "input": "http://example.com/foo%00%51",
  2012. "base": "about:blank",
  2013. "href": "http://example.com/foo%00%51",
  2014. "origin": "http://example.com",
  2015. "protocol": "http:",
  2016. "username": "",
  2017. "password": "",
  2018. "host": "example.com",
  2019. "hostname": "example.com",
  2020. "port": "",
  2021. "pathname": "/foo%00%51",
  2022. "search": "",
  2023. "hash": ""
  2024. },
  2025. {
  2026. "input": "http://example.com/(%28:%3A%29)",
  2027. "base": "about:blank",
  2028. "href": "http://example.com/(%28:%3A%29)",
  2029. "origin": "http://example.com",
  2030. "protocol": "http:",
  2031. "username": "",
  2032. "password": "",
  2033. "host": "example.com",
  2034. "hostname": "example.com",
  2035. "port": "",
  2036. "pathname": "/(%28:%3A%29)",
  2037. "search": "",
  2038. "hash": ""
  2039. },
  2040. {
  2041. "input": "http://example.com/%3A%3a%3C%3c",
  2042. "base": "about:blank",
  2043. "href": "http://example.com/%3A%3a%3C%3c",
  2044. "origin": "http://example.com",
  2045. "protocol": "http:",
  2046. "username": "",
  2047. "password": "",
  2048. "host": "example.com",
  2049. "hostname": "example.com",
  2050. "port": "",
  2051. "pathname": "/%3A%3a%3C%3c",
  2052. "search": "",
  2053. "hash": ""
  2054. },
  2055. {
  2056. "input": "http://example.com/foo\tbar",
  2057. "base": "about:blank",
  2058. "href": "http://example.com/foobar",
  2059. "origin": "http://example.com",
  2060. "protocol": "http:",
  2061. "username": "",
  2062. "password": "",
  2063. "host": "example.com",
  2064. "hostname": "example.com",
  2065. "port": "",
  2066. "pathname": "/foobar",
  2067. "search": "",
  2068. "hash": ""
  2069. },
  2070. {
  2071. "input": "http://example.com\\\\foo\\\\bar",
  2072. "base": "about:blank",
  2073. "href": "http://example.com//foo//bar",
  2074. "origin": "http://example.com",
  2075. "protocol": "http:",
  2076. "username": "",
  2077. "password": "",
  2078. "host": "example.com",
  2079. "hostname": "example.com",
  2080. "port": "",
  2081. "pathname": "//foo//bar",
  2082. "search": "",
  2083. "hash": ""
  2084. },
  2085. {
  2086. "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2087. "base": "about:blank",
  2088. "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2089. "origin": "http://example.com",
  2090. "protocol": "http:",
  2091. "username": "",
  2092. "password": "",
  2093. "host": "example.com",
  2094. "hostname": "example.com",
  2095. "port": "",
  2096. "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2097. "search": "",
  2098. "hash": ""
  2099. },
  2100. {
  2101. "input": "http://example.com/@asdf%40",
  2102. "base": "about:blank",
  2103. "href": "http://example.com/@asdf%40",
  2104. "origin": "http://example.com",
  2105. "protocol": "http:",
  2106. "username": "",
  2107. "password": "",
  2108. "host": "example.com",
  2109. "hostname": "example.com",
  2110. "port": "",
  2111. "pathname": "/@asdf%40",
  2112. "search": "",
  2113. "hash": ""
  2114. },
  2115. {
  2116. "input": "http://example.com/你好你好",
  2117. "base": "about:blank",
  2118. "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2119. "origin": "http://example.com",
  2120. "protocol": "http:",
  2121. "username": "",
  2122. "password": "",
  2123. "host": "example.com",
  2124. "hostname": "example.com",
  2125. "port": "",
  2126. "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2127. "search": "",
  2128. "hash": ""
  2129. },
  2130. {
  2131. "input": "http://example.com/‥/foo",
  2132. "base": "about:blank",
  2133. "href": "http://example.com/%E2%80%A5/foo",
  2134. "origin": "http://example.com",
  2135. "protocol": "http:",
  2136. "username": "",
  2137. "password": "",
  2138. "host": "example.com",
  2139. "hostname": "example.com",
  2140. "port": "",
  2141. "pathname": "/%E2%80%A5/foo",
  2142. "search": "",
  2143. "hash": ""
  2144. },
  2145. {
  2146. "input": "http://example.com//foo",
  2147. "base": "about:blank",
  2148. "href": "http://example.com/%EF%BB%BF/foo",
  2149. "origin": "http://example.com",
  2150. "protocol": "http:",
  2151. "username": "",
  2152. "password": "",
  2153. "host": "example.com",
  2154. "hostname": "example.com",
  2155. "port": "",
  2156. "pathname": "/%EF%BB%BF/foo",
  2157. "search": "",
  2158. "hash": ""
  2159. },
  2160. {
  2161. "input": "http://example.com/‮/foo/‭/bar",
  2162. "base": "about:blank",
  2163. "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar",
  2164. "origin": "http://example.com",
  2165. "protocol": "http:",
  2166. "username": "",
  2167. "password": "",
  2168. "host": "example.com",
  2169. "hostname": "example.com",
  2170. "port": "",
  2171. "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
  2172. "search": "",
  2173. "hash": ""
  2174. },
  2175. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js",
  2176. {
  2177. "input": "http://www.google.com/foo?bar=baz#",
  2178. "base": "about:blank",
  2179. "href": "http://www.google.com/foo?bar=baz#",
  2180. "origin": "http://www.google.com",
  2181. "protocol": "http:",
  2182. "username": "",
  2183. "password": "",
  2184. "host": "www.google.com",
  2185. "hostname": "www.google.com",
  2186. "port": "",
  2187. "pathname": "/foo",
  2188. "search": "?bar=baz",
  2189. "hash": ""
  2190. },
  2191. {
  2192. "input": "http://www.google.com/foo?bar=baz# »",
  2193. "base": "about:blank",
  2194. "href": "http://www.google.com/foo?bar=baz# %C2%BB",
  2195. "origin": "http://www.google.com",
  2196. "protocol": "http:",
  2197. "username": "",
  2198. "password": "",
  2199. "host": "www.google.com",
  2200. "hostname": "www.google.com",
  2201. "port": "",
  2202. "pathname": "/foo",
  2203. "search": "?bar=baz",
  2204. "hash": "# %C2%BB"
  2205. },
  2206. {
  2207. "input": "data:test# »",
  2208. "base": "about:blank",
  2209. "href": "data:test# %C2%BB",
  2210. "origin": "null",
  2211. "protocol": "data:",
  2212. "username": "",
  2213. "password": "",
  2214. "host": "",
  2215. "hostname": "",
  2216. "port": "",
  2217. "pathname": "test",
  2218. "search": "",
  2219. "hash": "# %C2%BB"
  2220. },
  2221. {
  2222. "input": "http://[www.google.com]/",
  2223. "base": "about:blank",
  2224. "failure": true
  2225. },
  2226. {
  2227. "input": "http://www.google.com",
  2228. "base": "about:blank",
  2229. "href": "http://www.google.com/",
  2230. "origin": "http://www.google.com",
  2231. "protocol": "http:",
  2232. "username": "",
  2233. "password": "",
  2234. "host": "www.google.com",
  2235. "hostname": "www.google.com",
  2236. "port": "",
  2237. "pathname": "/",
  2238. "search": "",
  2239. "hash": ""
  2240. },
  2241. {
  2242. "input": "http://192.0x00A80001",
  2243. "base": "about:blank",
  2244. "href": "http://192.168.0.1/",
  2245. "origin": "http://192.168.0.1",
  2246. "protocol": "http:",
  2247. "username": "",
  2248. "password": "",
  2249. "host": "192.168.0.1",
  2250. "hostname": "192.168.0.1",
  2251. "port": "",
  2252. "pathname": "/",
  2253. "search": "",
  2254. "hash": ""
  2255. },
  2256. {
  2257. "input": "http://www/foo%2Ehtml",
  2258. "base": "about:blank",
  2259. "href": "http://www/foo.html",
  2260. "origin": "http://www",
  2261. "protocol": "http:",
  2262. "username": "",
  2263. "password": "",
  2264. "host": "www",
  2265. "hostname": "www",
  2266. "port": "",
  2267. "pathname": "/foo.html",
  2268. "search": "",
  2269. "hash": ""
  2270. },
  2271. {
  2272. "input": "http://www/foo/%2E/html",
  2273. "base": "about:blank",
  2274. "href": "http://www/foo/html",
  2275. "origin": "http://www",
  2276. "protocol": "http:",
  2277. "username": "",
  2278. "password": "",
  2279. "host": "www",
  2280. "hostname": "www",
  2281. "port": "",
  2282. "pathname": "/foo/html",
  2283. "search": "",
  2284. "hash": ""
  2285. },
  2286. {
  2287. "input": "http://user:pass@/",
  2288. "base": "about:blank",
  2289. "failure": true
  2290. },
  2291. {
  2292. "input": "http://%25DOMAIN:foobar@foodomain.com/",
  2293. "base": "about:blank",
  2294. "href": "http://%25DOMAIN:foobar@foodomain.com/",
  2295. "origin": "http://foodomain.com",
  2296. "protocol": "http:",
  2297. "username": "%25DOMAIN",
  2298. "password": "foobar",
  2299. "host": "foodomain.com",
  2300. "hostname": "foodomain.com",
  2301. "port": "",
  2302. "pathname": "/",
  2303. "search": "",
  2304. "hash": ""
  2305. },
  2306. {
  2307. "input": "http:\\\\www.google.com\\foo",
  2308. "base": "about:blank",
  2309. "href": "http://www.google.com/foo",
  2310. "origin": "http://www.google.com",
  2311. "protocol": "http:",
  2312. "username": "",
  2313. "password": "",
  2314. "host": "www.google.com",
  2315. "hostname": "www.google.com",
  2316. "port": "",
  2317. "pathname": "/foo",
  2318. "search": "",
  2319. "hash": ""
  2320. },
  2321. {
  2322. "input": "http://foo:80/",
  2323. "base": "about:blank",
  2324. "href": "http://foo/",
  2325. "origin": "http://foo",
  2326. "protocol": "http:",
  2327. "username": "",
  2328. "password": "",
  2329. "host": "foo",
  2330. "hostname": "foo",
  2331. "port": "",
  2332. "pathname": "/",
  2333. "search": "",
  2334. "hash": ""
  2335. },
  2336. {
  2337. "input": "http://foo:81/",
  2338. "base": "about:blank",
  2339. "href": "http://foo:81/",
  2340. "origin": "http://foo:81",
  2341. "protocol": "http:",
  2342. "username": "",
  2343. "password": "",
  2344. "host": "foo:81",
  2345. "hostname": "foo",
  2346. "port": "81",
  2347. "pathname": "/",
  2348. "search": "",
  2349. "hash": ""
  2350. },
  2351. {
  2352. "input": "httpa://foo:80/",
  2353. "base": "about:blank",
  2354. "href": "httpa://foo:80/",
  2355. "origin": "null",
  2356. "protocol": "httpa:",
  2357. "username": "",
  2358. "password": "",
  2359. "host": "foo:80",
  2360. "hostname": "foo",
  2361. "port": "80",
  2362. "pathname": "/",
  2363. "search": "",
  2364. "hash": ""
  2365. },
  2366. {
  2367. "input": "http://foo:-80/",
  2368. "base": "about:blank",
  2369. "failure": true
  2370. },
  2371. {
  2372. "input": "https://foo:443/",
  2373. "base": "about:blank",
  2374. "href": "https://foo/",
  2375. "origin": "https://foo",
  2376. "protocol": "https:",
  2377. "username": "",
  2378. "password": "",
  2379. "host": "foo",
  2380. "hostname": "foo",
  2381. "port": "",
  2382. "pathname": "/",
  2383. "search": "",
  2384. "hash": ""
  2385. },
  2386. {
  2387. "input": "https://foo:80/",
  2388. "base": "about:blank",
  2389. "href": "https://foo:80/",
  2390. "origin": "https://foo:80",
  2391. "protocol": "https:",
  2392. "username": "",
  2393. "password": "",
  2394. "host": "foo:80",
  2395. "hostname": "foo",
  2396. "port": "80",
  2397. "pathname": "/",
  2398. "search": "",
  2399. "hash": ""
  2400. },
  2401. {
  2402. "input": "ftp://foo:21/",
  2403. "base": "about:blank",
  2404. "href": "ftp://foo/",
  2405. "origin": "ftp://foo",
  2406. "protocol": "ftp:",
  2407. "username": "",
  2408. "password": "",
  2409. "host": "foo",
  2410. "hostname": "foo",
  2411. "port": "",
  2412. "pathname": "/",
  2413. "search": "",
  2414. "hash": ""
  2415. },
  2416. {
  2417. "input": "ftp://foo:80/",
  2418. "base": "about:blank",
  2419. "href": "ftp://foo:80/",
  2420. "origin": "ftp://foo:80",
  2421. "protocol": "ftp:",
  2422. "username": "",
  2423. "password": "",
  2424. "host": "foo:80",
  2425. "hostname": "foo",
  2426. "port": "80",
  2427. "pathname": "/",
  2428. "search": "",
  2429. "hash": ""
  2430. },
  2431. {
  2432. "input": "gopher://foo:70/",
  2433. "base": "about:blank",
  2434. "href": "gopher://foo/",
  2435. "origin": "gopher://foo",
  2436. "protocol": "gopher:",
  2437. "username": "",
  2438. "password": "",
  2439. "host": "foo",
  2440. "hostname": "foo",
  2441. "port": "",
  2442. "pathname": "/",
  2443. "search": "",
  2444. "hash": ""
  2445. },
  2446. {
  2447. "input": "gopher://foo:443/",
  2448. "base": "about:blank",
  2449. "href": "gopher://foo:443/",
  2450. "origin": "gopher://foo:443",
  2451. "protocol": "gopher:",
  2452. "username": "",
  2453. "password": "",
  2454. "host": "foo:443",
  2455. "hostname": "foo",
  2456. "port": "443",
  2457. "pathname": "/",
  2458. "search": "",
  2459. "hash": ""
  2460. },
  2461. {
  2462. "input": "ws://foo:80/",
  2463. "base": "about:blank",
  2464. "href": "ws://foo/",
  2465. "origin": "ws://foo",
  2466. "protocol": "ws:",
  2467. "username": "",
  2468. "password": "",
  2469. "host": "foo",
  2470. "hostname": "foo",
  2471. "port": "",
  2472. "pathname": "/",
  2473. "search": "",
  2474. "hash": ""
  2475. },
  2476. {
  2477. "input": "ws://foo:81/",
  2478. "base": "about:blank",
  2479. "href": "ws://foo:81/",
  2480. "origin": "ws://foo:81",
  2481. "protocol": "ws:",
  2482. "username": "",
  2483. "password": "",
  2484. "host": "foo:81",
  2485. "hostname": "foo",
  2486. "port": "81",
  2487. "pathname": "/",
  2488. "search": "",
  2489. "hash": ""
  2490. },
  2491. {
  2492. "input": "ws://foo:443/",
  2493. "base": "about:blank",
  2494. "href": "ws://foo:443/",
  2495. "origin": "ws://foo:443",
  2496. "protocol": "ws:",
  2497. "username": "",
  2498. "password": "",
  2499. "host": "foo:443",
  2500. "hostname": "foo",
  2501. "port": "443",
  2502. "pathname": "/",
  2503. "search": "",
  2504. "hash": ""
  2505. },
  2506. {
  2507. "input": "ws://foo:815/",
  2508. "base": "about:blank",
  2509. "href": "ws://foo:815/",
  2510. "origin": "ws://foo:815",
  2511. "protocol": "ws:",
  2512. "username": "",
  2513. "password": "",
  2514. "host": "foo:815",
  2515. "hostname": "foo",
  2516. "port": "815",
  2517. "pathname": "/",
  2518. "search": "",
  2519. "hash": ""
  2520. },
  2521. {
  2522. "input": "wss://foo:80/",
  2523. "base": "about:blank",
  2524. "href": "wss://foo:80/",
  2525. "origin": "wss://foo:80",
  2526. "protocol": "wss:",
  2527. "username": "",
  2528. "password": "",
  2529. "host": "foo:80",
  2530. "hostname": "foo",
  2531. "port": "80",
  2532. "pathname": "/",
  2533. "search": "",
  2534. "hash": ""
  2535. },
  2536. {
  2537. "input": "wss://foo:81/",
  2538. "base": "about:blank",
  2539. "href": "wss://foo:81/",
  2540. "origin": "wss://foo:81",
  2541. "protocol": "wss:",
  2542. "username": "",
  2543. "password": "",
  2544. "host": "foo:81",
  2545. "hostname": "foo",
  2546. "port": "81",
  2547. "pathname": "/",
  2548. "search": "",
  2549. "hash": ""
  2550. },
  2551. {
  2552. "input": "wss://foo:443/",
  2553. "base": "about:blank",
  2554. "href": "wss://foo/",
  2555. "origin": "wss://foo",
  2556. "protocol": "wss:",
  2557. "username": "",
  2558. "password": "",
  2559. "host": "foo",
  2560. "hostname": "foo",
  2561. "port": "",
  2562. "pathname": "/",
  2563. "search": "",
  2564. "hash": ""
  2565. },
  2566. {
  2567. "input": "wss://foo:815/",
  2568. "base": "about:blank",
  2569. "href": "wss://foo:815/",
  2570. "origin": "wss://foo:815",
  2571. "protocol": "wss:",
  2572. "username": "",
  2573. "password": "",
  2574. "host": "foo:815",
  2575. "hostname": "foo",
  2576. "port": "815",
  2577. "pathname": "/",
  2578. "search": "",
  2579. "hash": ""
  2580. },
  2581. {
  2582. "input": "http:/example.com/",
  2583. "base": "about:blank",
  2584. "href": "http://example.com/",
  2585. "origin": "http://example.com",
  2586. "protocol": "http:",
  2587. "username": "",
  2588. "password": "",
  2589. "host": "example.com",
  2590. "hostname": "example.com",
  2591. "port": "",
  2592. "pathname": "/",
  2593. "search": "",
  2594. "hash": ""
  2595. },
  2596. {
  2597. "input": "ftp:/example.com/",
  2598. "base": "about:blank",
  2599. "href": "ftp://example.com/",
  2600. "origin": "ftp://example.com",
  2601. "protocol": "ftp:",
  2602. "username": "",
  2603. "password": "",
  2604. "host": "example.com",
  2605. "hostname": "example.com",
  2606. "port": "",
  2607. "pathname": "/",
  2608. "search": "",
  2609. "hash": ""
  2610. },
  2611. {
  2612. "input": "https:/example.com/",
  2613. "base": "about:blank",
  2614. "href": "https://example.com/",
  2615. "origin": "https://example.com",
  2616. "protocol": "https:",
  2617. "username": "",
  2618. "password": "",
  2619. "host": "example.com",
  2620. "hostname": "example.com",
  2621. "port": "",
  2622. "pathname": "/",
  2623. "search": "",
  2624. "hash": ""
  2625. },
  2626. {
  2627. "input": "madeupscheme:/example.com/",
  2628. "base": "about:blank",
  2629. "href": "madeupscheme:/example.com/",
  2630. "origin": "null",
  2631. "protocol": "madeupscheme:",
  2632. "username": "",
  2633. "password": "",
  2634. "host": "",
  2635. "hostname": "",
  2636. "port": "",
  2637. "pathname": "/example.com/",
  2638. "search": "",
  2639. "hash": ""
  2640. },
  2641. {
  2642. "input": "file:/example.com/",
  2643. "base": "about:blank",
  2644. "href": "file:///example.com/",
  2645. "protocol": "file:",
  2646. "username": "",
  2647. "password": "",
  2648. "host": "",
  2649. "hostname": "",
  2650. "port": "",
  2651. "pathname": "/example.com/",
  2652. "search": "",
  2653. "hash": ""
  2654. },
  2655. {
  2656. "input": "ftps:/example.com/",
  2657. "base": "about:blank",
  2658. "href": "ftps:/example.com/",
  2659. "origin": "null",
  2660. "protocol": "ftps:",
  2661. "username": "",
  2662. "password": "",
  2663. "host": "",
  2664. "hostname": "",
  2665. "port": "",
  2666. "pathname": "/example.com/",
  2667. "search": "",
  2668. "hash": ""
  2669. },
  2670. {
  2671. "input": "gopher:/example.com/",
  2672. "base": "about:blank",
  2673. "href": "gopher://example.com/",
  2674. "origin": "gopher://example.com",
  2675. "protocol": "gopher:",
  2676. "username": "",
  2677. "password": "",
  2678. "host": "example.com",
  2679. "hostname": "example.com",
  2680. "port": "",
  2681. "pathname": "/",
  2682. "search": "",
  2683. "hash": ""
  2684. },
  2685. {
  2686. "input": "ws:/example.com/",
  2687. "base": "about:blank",
  2688. "href": "ws://example.com/",
  2689. "origin": "ws://example.com",
  2690. "protocol": "ws:",
  2691. "username": "",
  2692. "password": "",
  2693. "host": "example.com",
  2694. "hostname": "example.com",
  2695. "port": "",
  2696. "pathname": "/",
  2697. "search": "",
  2698. "hash": ""
  2699. },
  2700. {
  2701. "input": "wss:/example.com/",
  2702. "base": "about:blank",
  2703. "href": "wss://example.com/",
  2704. "origin": "wss://example.com",
  2705. "protocol": "wss:",
  2706. "username": "",
  2707. "password": "",
  2708. "host": "example.com",
  2709. "hostname": "example.com",
  2710. "port": "",
  2711. "pathname": "/",
  2712. "search": "",
  2713. "hash": ""
  2714. },
  2715. {
  2716. "input": "data:/example.com/",
  2717. "base": "about:blank",
  2718. "href": "data:/example.com/",
  2719. "origin": "null",
  2720. "protocol": "data:",
  2721. "username": "",
  2722. "password": "",
  2723. "host": "",
  2724. "hostname": "",
  2725. "port": "",
  2726. "pathname": "/example.com/",
  2727. "search": "",
  2728. "hash": ""
  2729. },
  2730. {
  2731. "input": "javascript:/example.com/",
  2732. "base": "about:blank",
  2733. "href": "javascript:/example.com/",
  2734. "origin": "null",
  2735. "protocol": "javascript:",
  2736. "username": "",
  2737. "password": "",
  2738. "host": "",
  2739. "hostname": "",
  2740. "port": "",
  2741. "pathname": "/example.com/",
  2742. "search": "",
  2743. "hash": ""
  2744. },
  2745. {
  2746. "input": "mailto:/example.com/",
  2747. "base": "about:blank",
  2748. "href": "mailto:/example.com/",
  2749. "origin": "null",
  2750. "protocol": "mailto:",
  2751. "username": "",
  2752. "password": "",
  2753. "host": "",
  2754. "hostname": "",
  2755. "port": "",
  2756. "pathname": "/example.com/",
  2757. "search": "",
  2758. "hash": ""
  2759. },
  2760. {
  2761. "input": "http:example.com/",
  2762. "base": "about:blank",
  2763. "href": "http://example.com/",
  2764. "origin": "http://example.com",
  2765. "protocol": "http:",
  2766. "username": "",
  2767. "password": "",
  2768. "host": "example.com",
  2769. "hostname": "example.com",
  2770. "port": "",
  2771. "pathname": "/",
  2772. "search": "",
  2773. "hash": ""
  2774. },
  2775. {
  2776. "input": "ftp:example.com/",
  2777. "base": "about:blank",
  2778. "href": "ftp://example.com/",
  2779. "origin": "ftp://example.com",
  2780. "protocol": "ftp:",
  2781. "username": "",
  2782. "password": "",
  2783. "host": "example.com",
  2784. "hostname": "example.com",
  2785. "port": "",
  2786. "pathname": "/",
  2787. "search": "",
  2788. "hash": ""
  2789. },
  2790. {
  2791. "input": "https:example.com/",
  2792. "base": "about:blank",
  2793. "href": "https://example.com/",
  2794. "origin": "https://example.com",
  2795. "protocol": "https:",
  2796. "username": "",
  2797. "password": "",
  2798. "host": "example.com",
  2799. "hostname": "example.com",
  2800. "port": "",
  2801. "pathname": "/",
  2802. "search": "",
  2803. "hash": ""
  2804. },
  2805. {
  2806. "input": "madeupscheme:example.com/",
  2807. "base": "about:blank",
  2808. "href": "madeupscheme:example.com/",
  2809. "origin": "null",
  2810. "protocol": "madeupscheme:",
  2811. "username": "",
  2812. "password": "",
  2813. "host": "",
  2814. "hostname": "",
  2815. "port": "",
  2816. "pathname": "example.com/",
  2817. "search": "",
  2818. "hash": ""
  2819. },
  2820. {
  2821. "input": "ftps:example.com/",
  2822. "base": "about:blank",
  2823. "href": "ftps:example.com/",
  2824. "origin": "null",
  2825. "protocol": "ftps:",
  2826. "username": "",
  2827. "password": "",
  2828. "host": "",
  2829. "hostname": "",
  2830. "port": "",
  2831. "pathname": "example.com/",
  2832. "search": "",
  2833. "hash": ""
  2834. },
  2835. {
  2836. "input": "gopher:example.com/",
  2837. "base": "about:blank",
  2838. "href": "gopher://example.com/",
  2839. "origin": "gopher://example.com",
  2840. "protocol": "gopher:",
  2841. "username": "",
  2842. "password": "",
  2843. "host": "example.com",
  2844. "hostname": "example.com",
  2845. "port": "",
  2846. "pathname": "/",
  2847. "search": "",
  2848. "hash": ""
  2849. },
  2850. {
  2851. "input": "ws:example.com/",
  2852. "base": "about:blank",
  2853. "href": "ws://example.com/",
  2854. "origin": "ws://example.com",
  2855. "protocol": "ws:",
  2856. "username": "",
  2857. "password": "",
  2858. "host": "example.com",
  2859. "hostname": "example.com",
  2860. "port": "",
  2861. "pathname": "/",
  2862. "search": "",
  2863. "hash": ""
  2864. },
  2865. {
  2866. "input": "wss:example.com/",
  2867. "base": "about:blank",
  2868. "href": "wss://example.com/",
  2869. "origin": "wss://example.com",
  2870. "protocol": "wss:",
  2871. "username": "",
  2872. "password": "",
  2873. "host": "example.com",
  2874. "hostname": "example.com",
  2875. "port": "",
  2876. "pathname": "/",
  2877. "search": "",
  2878. "hash": ""
  2879. },
  2880. {
  2881. "input": "data:example.com/",
  2882. "base": "about:blank",
  2883. "href": "data:example.com/",
  2884. "origin": "null",
  2885. "protocol": "data:",
  2886. "username": "",
  2887. "password": "",
  2888. "host": "",
  2889. "hostname": "",
  2890. "port": "",
  2891. "pathname": "example.com/",
  2892. "search": "",
  2893. "hash": ""
  2894. },
  2895. {
  2896. "input": "javascript:example.com/",
  2897. "base": "about:blank",
  2898. "href": "javascript:example.com/",
  2899. "origin": "null",
  2900. "protocol": "javascript:",
  2901. "username": "",
  2902. "password": "",
  2903. "host": "",
  2904. "hostname": "",
  2905. "port": "",
  2906. "pathname": "example.com/",
  2907. "search": "",
  2908. "hash": ""
  2909. },
  2910. {
  2911. "input": "mailto:example.com/",
  2912. "base": "about:blank",
  2913. "href": "mailto:example.com/",
  2914. "origin": "null",
  2915. "protocol": "mailto:",
  2916. "username": "",
  2917. "password": "",
  2918. "host": "",
  2919. "hostname": "",
  2920. "port": "",
  2921. "pathname": "example.com/",
  2922. "search": "",
  2923. "hash": ""
  2924. },
  2925. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html",
  2926. {
  2927. "input": "http:@www.example.com",
  2928. "base": "about:blank",
  2929. "href": "http://www.example.com/",
  2930. "origin": "http://www.example.com",
  2931. "protocol": "http:",
  2932. "username": "",
  2933. "password": "",
  2934. "host": "www.example.com",
  2935. "hostname": "www.example.com",
  2936. "port": "",
  2937. "pathname": "/",
  2938. "search": "",
  2939. "hash": ""
  2940. },
  2941. {
  2942. "input": "http:/@www.example.com",
  2943. "base": "about:blank",
  2944. "href": "http://www.example.com/",
  2945. "origin": "http://www.example.com",
  2946. "protocol": "http:",
  2947. "username": "",
  2948. "password": "",
  2949. "host": "www.example.com",
  2950. "hostname": "www.example.com",
  2951. "port": "",
  2952. "pathname": "/",
  2953. "search": "",
  2954. "hash": ""
  2955. },
  2956. {
  2957. "input": "http://@www.example.com",
  2958. "base": "about:blank",
  2959. "href": "http://www.example.com/",
  2960. "origin": "http://www.example.com",
  2961. "protocol": "http:",
  2962. "username": "",
  2963. "password": "",
  2964. "host": "www.example.com",
  2965. "hostname": "www.example.com",
  2966. "port": "",
  2967. "pathname": "/",
  2968. "search": "",
  2969. "hash": ""
  2970. },
  2971. {
  2972. "input": "http:a:b@www.example.com",
  2973. "base": "about:blank",
  2974. "href": "http://a:b@www.example.com/",
  2975. "origin": "http://www.example.com",
  2976. "protocol": "http:",
  2977. "username": "a",
  2978. "password": "b",
  2979. "host": "www.example.com",
  2980. "hostname": "www.example.com",
  2981. "port": "",
  2982. "pathname": "/",
  2983. "search": "",
  2984. "hash": ""
  2985. },
  2986. {
  2987. "input": "http:/a:b@www.example.com",
  2988. "base": "about:blank",
  2989. "href": "http://a:b@www.example.com/",
  2990. "origin": "http://www.example.com",
  2991. "protocol": "http:",
  2992. "username": "a",
  2993. "password": "b",
  2994. "host": "www.example.com",
  2995. "hostname": "www.example.com",
  2996. "port": "",
  2997. "pathname": "/",
  2998. "search": "",
  2999. "hash": ""
  3000. },
  3001. {
  3002. "input": "http://a:b@www.example.com",
  3003. "base": "about:blank",
  3004. "href": "http://a:b@www.example.com/",
  3005. "origin": "http://www.example.com",
  3006. "protocol": "http:",
  3007. "username": "a",
  3008. "password": "b",
  3009. "host": "www.example.com",
  3010. "hostname": "www.example.com",
  3011. "port": "",
  3012. "pathname": "/",
  3013. "search": "",
  3014. "hash": ""
  3015. },
  3016. {
  3017. "input": "http://@pple.com",
  3018. "base": "about:blank",
  3019. "href": "http://pple.com/",
  3020. "origin": "http://pple.com",
  3021. "protocol": "http:",
  3022. "username": "",
  3023. "password": "",
  3024. "host": "pple.com",
  3025. "hostname": "pple.com",
  3026. "port": "",
  3027. "pathname": "/",
  3028. "search": "",
  3029. "hash": ""
  3030. },
  3031. {
  3032. "input": "http::b@www.example.com",
  3033. "base": "about:blank",
  3034. "href": "http://:b@www.example.com/",
  3035. "origin": "http://www.example.com",
  3036. "protocol": "http:",
  3037. "username": "",
  3038. "password": "b",
  3039. "host": "www.example.com",
  3040. "hostname": "www.example.com",
  3041. "port": "",
  3042. "pathname": "/",
  3043. "search": "",
  3044. "hash": ""
  3045. },
  3046. {
  3047. "input": "http:/:b@www.example.com",
  3048. "base": "about:blank",
  3049. "href": "http://:b@www.example.com/",
  3050. "origin": "http://www.example.com",
  3051. "protocol": "http:",
  3052. "username": "",
  3053. "password": "b",
  3054. "host": "www.example.com",
  3055. "hostname": "www.example.com",
  3056. "port": "",
  3057. "pathname": "/",
  3058. "search": "",
  3059. "hash": ""
  3060. },
  3061. {
  3062. "input": "http://:b@www.example.com",
  3063. "base": "about:blank",
  3064. "href": "http://:b@www.example.com/",
  3065. "origin": "http://www.example.com",
  3066. "protocol": "http:",
  3067. "username": "",
  3068. "password": "b",
  3069. "host": "www.example.com",
  3070. "hostname": "www.example.com",
  3071. "port": "",
  3072. "pathname": "/",
  3073. "search": "",
  3074. "hash": ""
  3075. },
  3076. {
  3077. "input": "http:/:@/www.example.com",
  3078. "base": "about:blank",
  3079. "failure": true
  3080. },
  3081. {
  3082. "input": "http://user@/www.example.com",
  3083. "base": "about:blank",
  3084. "failure": true
  3085. },
  3086. {
  3087. "input": "http:@/www.example.com",
  3088. "base": "about:blank",
  3089. "failure": true
  3090. },
  3091. {
  3092. "input": "http:/@/www.example.com",
  3093. "base": "about:blank",
  3094. "failure": true
  3095. },
  3096. {
  3097. "input": "http://@/www.example.com",
  3098. "base": "about:blank",
  3099. "failure": true
  3100. },
  3101. {
  3102. "input": "https:@/www.example.com",
  3103. "base": "about:blank",
  3104. "failure": true
  3105. },
  3106. {
  3107. "input": "http:a:b@/www.example.com",
  3108. "base": "about:blank",
  3109. "failure": true
  3110. },
  3111. {
  3112. "input": "http:/a:b@/www.example.com",
  3113. "base": "about:blank",
  3114. "failure": true
  3115. },
  3116. {
  3117. "input": "http://a:b@/www.example.com",
  3118. "base": "about:blank",
  3119. "failure": true
  3120. },
  3121. {
  3122. "input": "http::@/www.example.com",
  3123. "base": "about:blank",
  3124. "failure": true
  3125. },
  3126. {
  3127. "input": "http:a:@www.example.com",
  3128. "base": "about:blank",
  3129. "href": "http://a@www.example.com/",
  3130. "origin": "http://www.example.com",
  3131. "protocol": "http:",
  3132. "username": "a",
  3133. "password": "",
  3134. "host": "www.example.com",
  3135. "hostname": "www.example.com",
  3136. "port": "",
  3137. "pathname": "/",
  3138. "search": "",
  3139. "hash": ""
  3140. },
  3141. {
  3142. "input": "http:/a:@www.example.com",
  3143. "base": "about:blank",
  3144. "href": "http://a@www.example.com/",
  3145. "origin": "http://www.example.com",
  3146. "protocol": "http:",
  3147. "username": "a",
  3148. "password": "",
  3149. "host": "www.example.com",
  3150. "hostname": "www.example.com",
  3151. "port": "",
  3152. "pathname": "/",
  3153. "search": "",
  3154. "hash": ""
  3155. },
  3156. {
  3157. "input": "http://a:@www.example.com",
  3158. "base": "about:blank",
  3159. "href": "http://a@www.example.com/",
  3160. "origin": "http://www.example.com",
  3161. "protocol": "http:",
  3162. "username": "a",
  3163. "password": "",
  3164. "host": "www.example.com",
  3165. "hostname": "www.example.com",
  3166. "port": "",
  3167. "pathname": "/",
  3168. "search": "",
  3169. "hash": ""
  3170. },
  3171. {
  3172. "input": "http://www.@pple.com",
  3173. "base": "about:blank",
  3174. "href": "http://www.@pple.com/",
  3175. "origin": "http://pple.com",
  3176. "protocol": "http:",
  3177. "username": "www.",
  3178. "password": "",
  3179. "host": "pple.com",
  3180. "hostname": "pple.com",
  3181. "port": "",
  3182. "pathname": "/",
  3183. "search": "",
  3184. "hash": ""
  3185. },
  3186. {
  3187. "input": "http:@:www.example.com",
  3188. "base": "about:blank",
  3189. "failure": true
  3190. },
  3191. {
  3192. "input": "http:/@:www.example.com",
  3193. "base": "about:blank",
  3194. "failure": true
  3195. },
  3196. {
  3197. "input": "http://@:www.example.com",
  3198. "base": "about:blank",
  3199. "failure": true
  3200. },
  3201. {
  3202. "input": "http://:@www.example.com",
  3203. "base": "about:blank",
  3204. "href": "http://www.example.com/",
  3205. "origin": "http://www.example.com",
  3206. "protocol": "http:",
  3207. "username": "",
  3208. "password": "",
  3209. "host": "www.example.com",
  3210. "hostname": "www.example.com",
  3211. "port": "",
  3212. "pathname": "/",
  3213. "search": "",
  3214. "hash": ""
  3215. },
  3216. {
  3217. "input": "http:a:@www.example.com",
  3218. "base": "about:blank",
  3219. "href": "http://a@www.example.com/",
  3220. "origin": "http://www.example.com",
  3221. "protocol": "http:",
  3222. "username": "a",
  3223. "password": "",
  3224. "host": "www.example.com",
  3225. "hostname": "www.example.com",
  3226. "port": "",
  3227. "pathname": "/",
  3228. "search": "",
  3229. "hash": ""
  3230. },
  3231. {
  3232. "input": "http:/a:@www.example.com",
  3233. "base": "about:blank",
  3234. "href": "http://a@www.example.com/",
  3235. "origin": "http://www.example.com",
  3236. "protocol": "http:",
  3237. "username": "a",
  3238. "password": "",
  3239. "host": "www.example.com",
  3240. "hostname": "www.example.com",
  3241. "port": "",
  3242. "pathname": "/",
  3243. "search": "",
  3244. "hash": ""
  3245. },
  3246. {
  3247. "input": "http://a:@www.example.com",
  3248. "base": "about:blank",
  3249. "href": "http://a@www.example.com/",
  3250. "origin": "http://www.example.com",
  3251. "protocol": "http:",
  3252. "username": "a",
  3253. "password": "",
  3254. "host": "www.example.com",
  3255. "hostname": "www.example.com",
  3256. "port": "",
  3257. "pathname": "/",
  3258. "search": "",
  3259. "hash": ""
  3260. },
  3261. {
  3262. "input": "http://:@www.example.com",
  3263. "base": "about:blank",
  3264. "href": "http://www.example.com/",
  3265. "origin": "http://www.example.com",
  3266. "protocol": "http:",
  3267. "username": "",
  3268. "password": "",
  3269. "host": "www.example.com",
  3270. "hostname": "www.example.com",
  3271. "port": "",
  3272. "pathname": "/",
  3273. "search": "",
  3274. "hash": ""
  3275. },
  3276. "# Others",
  3277. {
  3278. "input": "/",
  3279. "base": "http://www.example.com/test",
  3280. "href": "http://www.example.com/",
  3281. "origin": "http://www.example.com",
  3282. "protocol": "http:",
  3283. "username": "",
  3284. "password": "",
  3285. "host": "www.example.com",
  3286. "hostname": "www.example.com",
  3287. "port": "",
  3288. "pathname": "/",
  3289. "search": "",
  3290. "hash": ""
  3291. },
  3292. {
  3293. "input": "/test.txt",
  3294. "base": "http://www.example.com/test",
  3295. "href": "http://www.example.com/test.txt",
  3296. "origin": "http://www.example.com",
  3297. "protocol": "http:",
  3298. "username": "",
  3299. "password": "",
  3300. "host": "www.example.com",
  3301. "hostname": "www.example.com",
  3302. "port": "",
  3303. "pathname": "/test.txt",
  3304. "search": "",
  3305. "hash": ""
  3306. },
  3307. {
  3308. "input": ".",
  3309. "base": "http://www.example.com/test",
  3310. "href": "http://www.example.com/",
  3311. "origin": "http://www.example.com",
  3312. "protocol": "http:",
  3313. "username": "",
  3314. "password": "",
  3315. "host": "www.example.com",
  3316. "hostname": "www.example.com",
  3317. "port": "",
  3318. "pathname": "/",
  3319. "search": "",
  3320. "hash": ""
  3321. },
  3322. {
  3323. "input": "..",
  3324. "base": "http://www.example.com/test",
  3325. "href": "http://www.example.com/",
  3326. "origin": "http://www.example.com",
  3327. "protocol": "http:",
  3328. "username": "",
  3329. "password": "",
  3330. "host": "www.example.com",
  3331. "hostname": "www.example.com",
  3332. "port": "",
  3333. "pathname": "/",
  3334. "search": "",
  3335. "hash": ""
  3336. },
  3337. {
  3338. "input": "test.txt",
  3339. "base": "http://www.example.com/test",
  3340. "href": "http://www.example.com/test.txt",
  3341. "origin": "http://www.example.com",
  3342. "protocol": "http:",
  3343. "username": "",
  3344. "password": "",
  3345. "host": "www.example.com",
  3346. "hostname": "www.example.com",
  3347. "port": "",
  3348. "pathname": "/test.txt",
  3349. "search": "",
  3350. "hash": ""
  3351. },
  3352. {
  3353. "input": "./test.txt",
  3354. "base": "http://www.example.com/test",
  3355. "href": "http://www.example.com/test.txt",
  3356. "origin": "http://www.example.com",
  3357. "protocol": "http:",
  3358. "username": "",
  3359. "password": "",
  3360. "host": "www.example.com",
  3361. "hostname": "www.example.com",
  3362. "port": "",
  3363. "pathname": "/test.txt",
  3364. "search": "",
  3365. "hash": ""
  3366. },
  3367. {
  3368. "input": "../test.txt",
  3369. "base": "http://www.example.com/test",
  3370. "href": "http://www.example.com/test.txt",
  3371. "origin": "http://www.example.com",
  3372. "protocol": "http:",
  3373. "username": "",
  3374. "password": "",
  3375. "host": "www.example.com",
  3376. "hostname": "www.example.com",
  3377. "port": "",
  3378. "pathname": "/test.txt",
  3379. "search": "",
  3380. "hash": ""
  3381. },
  3382. {
  3383. "input": "../aaa/test.txt",
  3384. "base": "http://www.example.com/test",
  3385. "href": "http://www.example.com/aaa/test.txt",
  3386. "origin": "http://www.example.com",
  3387. "protocol": "http:",
  3388. "username": "",
  3389. "password": "",
  3390. "host": "www.example.com",
  3391. "hostname": "www.example.com",
  3392. "port": "",
  3393. "pathname": "/aaa/test.txt",
  3394. "search": "",
  3395. "hash": ""
  3396. },
  3397. {
  3398. "input": "../../test.txt",
  3399. "base": "http://www.example.com/test",
  3400. "href": "http://www.example.com/test.txt",
  3401. "origin": "http://www.example.com",
  3402. "protocol": "http:",
  3403. "username": "",
  3404. "password": "",
  3405. "host": "www.example.com",
  3406. "hostname": "www.example.com",
  3407. "port": "",
  3408. "pathname": "/test.txt",
  3409. "search": "",
  3410. "hash": ""
  3411. },
  3412. {
  3413. "input": "中/test.txt",
  3414. "base": "http://www.example.com/test",
  3415. "href": "http://www.example.com/%E4%B8%AD/test.txt",
  3416. "origin": "http://www.example.com",
  3417. "protocol": "http:",
  3418. "username": "",
  3419. "password": "",
  3420. "host": "www.example.com",
  3421. "hostname": "www.example.com",
  3422. "port": "",
  3423. "pathname": "/%E4%B8%AD/test.txt",
  3424. "search": "",
  3425. "hash": ""
  3426. },
  3427. {
  3428. "input": "http://www.example2.com",
  3429. "base": "http://www.example.com/test",
  3430. "href": "http://www.example2.com/",
  3431. "origin": "http://www.example2.com",
  3432. "protocol": "http:",
  3433. "username": "",
  3434. "password": "",
  3435. "host": "www.example2.com",
  3436. "hostname": "www.example2.com",
  3437. "port": "",
  3438. "pathname": "/",
  3439. "search": "",
  3440. "hash": ""
  3441. },
  3442. {
  3443. "input": "//www.example2.com",
  3444. "base": "http://www.example.com/test",
  3445. "href": "http://www.example2.com/",
  3446. "origin": "http://www.example2.com",
  3447. "protocol": "http:",
  3448. "username": "",
  3449. "password": "",
  3450. "host": "www.example2.com",
  3451. "hostname": "www.example2.com",
  3452. "port": "",
  3453. "pathname": "/",
  3454. "search": "",
  3455. "hash": ""
  3456. },
  3457. {
  3458. "input": "file:...",
  3459. "base": "http://www.example.com/test",
  3460. "href": "file:///...",
  3461. "protocol": "file:",
  3462. "username": "",
  3463. "password": "",
  3464. "host": "",
  3465. "hostname": "",
  3466. "port": "",
  3467. "pathname": "/...",
  3468. "search": "",
  3469. "hash": ""
  3470. },
  3471. {
  3472. "input": "file:..",
  3473. "base": "http://www.example.com/test",
  3474. "href": "file:///",
  3475. "protocol": "file:",
  3476. "username": "",
  3477. "password": "",
  3478. "host": "",
  3479. "hostname": "",
  3480. "port": "",
  3481. "pathname": "/",
  3482. "search": "",
  3483. "hash": ""
  3484. },
  3485. {
  3486. "input": "file:a",
  3487. "base": "http://www.example.com/test",
  3488. "href": "file:///a",
  3489. "protocol": "file:",
  3490. "username": "",
  3491. "password": "",
  3492. "host": "",
  3493. "hostname": "",
  3494. "port": "",
  3495. "pathname": "/a",
  3496. "search": "",
  3497. "hash": ""
  3498. },
  3499. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
  3500. "Basic canonicalization, uppercase should be converted to lowercase",
  3501. {
  3502. "input": "http://ExAmPlE.CoM",
  3503. "base": "http://other.com/",
  3504. "href": "http://example.com/",
  3505. "origin": "http://example.com",
  3506. "protocol": "http:",
  3507. "username": "",
  3508. "password": "",
  3509. "host": "example.com",
  3510. "hostname": "example.com",
  3511. "port": "",
  3512. "pathname": "/",
  3513. "search": "",
  3514. "hash": ""
  3515. },
  3516. {
  3517. "input": "http://example example.com",
  3518. "base": "http://other.com/",
  3519. "failure": true
  3520. },
  3521. {
  3522. "input": "http://Goo%20 goo%7C|.com",
  3523. "base": "http://other.com/",
  3524. "failure": true
  3525. },
  3526. {
  3527. "input": "http://[]",
  3528. "base": "http://other.com/",
  3529. "failure": true
  3530. },
  3531. {
  3532. "input": "http://[:]",
  3533. "base": "http://other.com/",
  3534. "failure": true
  3535. },
  3536. "U+3000 is mapped to U+0020 (space) which is disallowed",
  3537. {
  3538. "input": "http://GOO\u00a0\u3000goo.com",
  3539. "base": "http://other.com/",
  3540. "failure": true
  3541. },
  3542. "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",
  3543. {
  3544. "input": "http://GOO\u200b\u2060\ufeffgoo.com",
  3545. "base": "http://other.com/",
  3546. "href": "http://googoo.com/",
  3547. "origin": "http://googoo.com",
  3548. "protocol": "http:",
  3549. "username": "",
  3550. "password": "",
  3551. "host": "googoo.com",
  3552. "hostname": "googoo.com",
  3553. "port": "",
  3554. "pathname": "/",
  3555. "search": "",
  3556. "hash": ""
  3557. },
  3558. "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
  3559. {
  3560. "input": "http://www.foo。bar.com",
  3561. "base": "http://other.com/",
  3562. "href": "http://www.foo.bar.com/",
  3563. "origin": "http://www.foo.bar.com",
  3564. "protocol": "http:",
  3565. "username": "",
  3566. "password": "",
  3567. "host": "www.foo.bar.com",
  3568. "hostname": "www.foo.bar.com",
  3569. "port": "",
  3570. "pathname": "/",
  3571. "search": "",
  3572. "hash": ""
  3573. },
  3574. "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0",
  3575. {
  3576. "input": "http://\ufdd0zyx.com",
  3577. "base": "http://other.com/",
  3578. "failure": true
  3579. },
  3580. "This is the same as previous but escaped",
  3581. {
  3582. "input": "http://%ef%b7%90zyx.com",
  3583. "base": "http://other.com/",
  3584. "failure": true
  3585. },
  3586. "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.",
  3587. {
  3588. "input": "http://Go.com",
  3589. "base": "http://other.com/",
  3590. "href": "http://go.com/",
  3591. "origin": "http://go.com",
  3592. "protocol": "http:",
  3593. "username": "",
  3594. "password": "",
  3595. "host": "go.com",
  3596. "hostname": "go.com",
  3597. "port": "",
  3598. "pathname": "/",
  3599. "search": "",
  3600. "hash": ""
  3601. },
  3602. "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257",
  3603. {
  3604. "input": "http://%41.com",
  3605. "base": "http://other.com/",
  3606. "failure": true
  3607. },
  3608. {
  3609. "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com",
  3610. "base": "http://other.com/",
  3611. "failure": true
  3612. },
  3613. "...%00 in fullwidth should fail (also as escaped UTF-8 input)",
  3614. {
  3615. "input": "http://%00.com",
  3616. "base": "http://other.com/",
  3617. "failure": true
  3618. },
  3619. {
  3620. "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com",
  3621. "base": "http://other.com/",
  3622. "failure": true
  3623. },
  3624. "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
  3625. {
  3626. "input": "http://你好你好",
  3627. "base": "http://other.com/",
  3628. "href": "http://xn--6qqa088eba/",
  3629. "origin": "http://xn--6qqa088eba",
  3630. "protocol": "http:",
  3631. "username": "",
  3632. "password": "",
  3633. "host": "xn--6qqa088eba",
  3634. "hostname": "xn--6qqa088eba",
  3635. "port": "",
  3636. "pathname": "/",
  3637. "search": "",
  3638. "hash": ""
  3639. },
  3640. "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191",
  3641. {
  3642. "input": "http://%zz%66%a.com",
  3643. "base": "http://other.com/",
  3644. "failure": true
  3645. },
  3646. "If we get an invalid character that has been escaped.",
  3647. {
  3648. "input": "http://%25",
  3649. "base": "http://other.com/",
  3650. "failure": true
  3651. },
  3652. {
  3653. "input": "http://hello%00",
  3654. "base": "http://other.com/",
  3655. "failure": true
  3656. },
  3657. "Escaped numbers should be treated like IP addresses if they are.",
  3658. {
  3659. "input": "http://%30%78%63%30%2e%30%32%35%30.01",
  3660. "base": "http://other.com/",
  3661. "href": "http://192.168.0.1/",
  3662. "origin": "http://192.168.0.1",
  3663. "protocol": "http:",
  3664. "username": "",
  3665. "password": "",
  3666. "host": "192.168.0.1",
  3667. "hostname": "192.168.0.1",
  3668. "port": "",
  3669. "pathname": "/",
  3670. "search": "",
  3671. "hash": ""
  3672. },
  3673. {
  3674. "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e",
  3675. "base": "http://other.com/",
  3676. "href": "http://192.168.0.1/",
  3677. "origin": "http://192.168.0.1",
  3678. "protocol": "http:",
  3679. "username": "",
  3680. "password": "",
  3681. "host": "192.168.0.1",
  3682. "hostname": "192.168.0.1",
  3683. "port": "",
  3684. "pathname": "/",
  3685. "search": "",
  3686. "hash": ""
  3687. },
  3688. {
  3689. "input": "http://192.168.0.257",
  3690. "base": "http://other.com/",
  3691. "failure": true
  3692. },
  3693. "Invalid escaping should trigger the regular host error handling",
  3694. {
  3695. "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01",
  3696. "base": "http://other.com/",
  3697. "failure": true
  3698. },
  3699. "Something that isn't exactly an IP should get treated as a host and spaces escaped",
  3700. {
  3701. "input": "http://192.168.0.1 hello",
  3702. "base": "http://other.com/",
  3703. "failure": true
  3704. },
  3705. "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
  3706. {
  3707. "input": "http://0Xc0.0250.01",
  3708. "base": "http://other.com/",
  3709. "href": "http://192.168.0.1/",
  3710. "origin": "http://192.168.0.1",
  3711. "protocol": "http:",
  3712. "username": "",
  3713. "password": "",
  3714. "host": "192.168.0.1",
  3715. "hostname": "192.168.0.1",
  3716. "port": "",
  3717. "pathname": "/",
  3718. "search": "",
  3719. "hash": ""
  3720. },
  3721. "Broken IPv6",
  3722. {
  3723. "input": "http://[google.com]",
  3724. "base": "http://other.com/",
  3725. "failure": true
  3726. },
  3727. {
  3728. "input": "http://[::1.2.3.4x]",
  3729. "base": "http://other.com/",
  3730. "failure": true
  3731. },
  3732. {
  3733. "input": "http://[::1.2.3.]",
  3734. "base": "http://other.com/",
  3735. "failure": true
  3736. },
  3737. {
  3738. "input": "http://[::1.2.]",
  3739. "base": "http://other.com/",
  3740. "failure": true
  3741. },
  3742. {
  3743. "input": "http://[::1.]",
  3744. "base": "http://other.com/",
  3745. "failure": true
  3746. },
  3747. "Misc Unicode",
  3748. {
  3749. "input": "http://foo:💩@example.com/bar",
  3750. "base": "http://other.com/",
  3751. "href": "http://foo:%F0%9F%92%A9@example.com/bar",
  3752. "origin": "http://example.com",
  3753. "protocol": "http:",
  3754. "username": "foo",
  3755. "password": "%F0%9F%92%A9",
  3756. "host": "example.com",
  3757. "hostname": "example.com",
  3758. "port": "",
  3759. "pathname": "/bar",
  3760. "search": "",
  3761. "hash": ""
  3762. },
  3763. "# resolving a fragment against any scheme succeeds",
  3764. {
  3765. "input": "#",
  3766. "base": "test:test",
  3767. "href": "test:test#",
  3768. "origin": "null",
  3769. "protocol": "test:",
  3770. "username": "",
  3771. "password": "",
  3772. "host": "",
  3773. "hostname": "",
  3774. "port": "",
  3775. "pathname": "test",
  3776. "search": "",
  3777. "hash": ""
  3778. },
  3779. {
  3780. "input": "#x",
  3781. "base": "mailto:x@x.com",
  3782. "href": "mailto:x@x.com#x",
  3783. "origin": "null",
  3784. "protocol": "mailto:",
  3785. "username": "",
  3786. "password": "",
  3787. "host": "",
  3788. "hostname": "",
  3789. "port": "",
  3790. "pathname": "x@x.com",
  3791. "search": "",
  3792. "hash": "#x"
  3793. },
  3794. {
  3795. "input": "#x",
  3796. "base": "data:,",
  3797. "href": "data:,#x",
  3798. "origin": "null",
  3799. "protocol": "data:",
  3800. "username": "",
  3801. "password": "",
  3802. "host": "",
  3803. "hostname": "",
  3804. "port": "",
  3805. "pathname": ",",
  3806. "search": "",
  3807. "hash": "#x"
  3808. },
  3809. {
  3810. "input": "#x",
  3811. "base": "about:blank",
  3812. "href": "about:blank#x",
  3813. "origin": "null",
  3814. "protocol": "about:",
  3815. "username": "",
  3816. "password": "",
  3817. "host": "",
  3818. "hostname": "",
  3819. "port": "",
  3820. "pathname": "blank",
  3821. "search": "",
  3822. "hash": "#x"
  3823. },
  3824. {
  3825. "input": "#",
  3826. "base": "test:test?test",
  3827. "href": "test:test?test#",
  3828. "origin": "null",
  3829. "protocol": "test:",
  3830. "username": "",
  3831. "password": "",
  3832. "host": "",
  3833. "hostname": "",
  3834. "port": "",
  3835. "pathname": "test",
  3836. "search": "?test",
  3837. "hash": ""
  3838. },
  3839. "# multiple @ in authority state",
  3840. {
  3841. "input": "https://@test@test@example:800/",
  3842. "base": "http://doesnotmatter/",
  3843. "href": "https://%40test%40test@example:800/",
  3844. "origin": "https://example:800",
  3845. "protocol": "https:",
  3846. "username": "%40test%40test",
  3847. "password": "",
  3848. "host": "example:800",
  3849. "hostname": "example",
  3850. "port": "800",
  3851. "pathname": "/",
  3852. "search": "",
  3853. "hash": ""
  3854. },
  3855. {
  3856. "input": "https://@@@example",
  3857. "base": "http://doesnotmatter/",
  3858. "href": "https://%40%40@example/",
  3859. "origin": "https://example",
  3860. "protocol": "https:",
  3861. "username": "%40%40",
  3862. "password": "",
  3863. "host": "example",
  3864. "hostname": "example",
  3865. "port": "",
  3866. "pathname": "/",
  3867. "search": "",
  3868. "hash": ""
  3869. },
  3870. "non-az-09 characters",
  3871. {
  3872. "input": "http://`{}:`{}@h/`{}?`{}",
  3873. "base": "http://doesnotmatter/",
  3874. "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}",
  3875. "origin": "http://h",
  3876. "protocol": "http:",
  3877. "username": "%60%7B%7D",
  3878. "password": "%60%7B%7D",
  3879. "host": "h",
  3880. "hostname": "h",
  3881. "port": "",
  3882. "pathname": "/%60%7B%7D",
  3883. "search": "?`{}",
  3884. "hash": ""
  3885. },
  3886. "# Credentials in base",
  3887. {
  3888. "input": "/some/path",
  3889. "base": "http://user@example.org/smth",
  3890. "href": "http://user@example.org/some/path",
  3891. "origin": "http://example.org",
  3892. "protocol": "http:",
  3893. "username": "user",
  3894. "password": "",
  3895. "host": "example.org",
  3896. "hostname": "example.org",
  3897. "port": "",
  3898. "pathname": "/some/path",
  3899. "search": "",
  3900. "hash": ""
  3901. },
  3902. {
  3903. "input": "",
  3904. "base": "http://user:pass@example.org:21/smth",
  3905. "href": "http://user:pass@example.org:21/smth",
  3906. "origin": "http://example.org:21",
  3907. "protocol": "http:",
  3908. "username": "user",
  3909. "password": "pass",
  3910. "host": "example.org:21",
  3911. "hostname": "example.org",
  3912. "port": "21",
  3913. "pathname": "/smth",
  3914. "search": "",
  3915. "hash": ""
  3916. },
  3917. {
  3918. "input": "/some/path",
  3919. "base": "http://user:pass@example.org:21/smth",
  3920. "href": "http://user:pass@example.org:21/some/path",
  3921. "origin": "http://example.org:21",
  3922. "protocol": "http:",
  3923. "username": "user",
  3924. "password": "pass",
  3925. "host": "example.org:21",
  3926. "hostname": "example.org",
  3927. "port": "21",
  3928. "pathname": "/some/path",
  3929. "search": "",
  3930. "hash": ""
  3931. },
  3932. "# a set of tests designed by zcorpan for relative URLs with unknown schemes",
  3933. {
  3934. "input": "i",
  3935. "base": "sc:sd",
  3936. "failure": true
  3937. },
  3938. {
  3939. "input": "i",
  3940. "base": "sc:sd/sd",
  3941. "failure": true
  3942. },
  3943. {
  3944. "input": "i",
  3945. "base": "sc:/pa/pa",
  3946. "href": "sc:/pa/i",
  3947. "origin": "null",
  3948. "protocol": "sc:",
  3949. "username": "",
  3950. "password": "",
  3951. "host": "",
  3952. "hostname": "",
  3953. "port": "",
  3954. "pathname": "/pa/i",
  3955. "search": "",
  3956. "hash": ""
  3957. },
  3958. {
  3959. "input": "i",
  3960. "base": "sc://ho/pa",
  3961. "href": "sc://ho/i",
  3962. "origin": "null",
  3963. "protocol": "sc:",
  3964. "username": "",
  3965. "password": "",
  3966. "host": "ho",
  3967. "hostname": "ho",
  3968. "port": "",
  3969. "pathname": "/i",
  3970. "search": "",
  3971. "hash": ""
  3972. },
  3973. {
  3974. "input": "i",
  3975. "base": "sc:///pa/pa",
  3976. "href": "sc:///pa/i",
  3977. "origin": "null",
  3978. "protocol": "sc:",
  3979. "username": "",
  3980. "password": "",
  3981. "host": "",
  3982. "hostname": "",
  3983. "port": "",
  3984. "pathname": "/pa/i",
  3985. "search": "",
  3986. "hash": ""
  3987. },
  3988. {
  3989. "input": "../i",
  3990. "base": "sc:sd",
  3991. "failure": true
  3992. },
  3993. {
  3994. "input": "../i",
  3995. "base": "sc:sd/sd",
  3996. "failure": true
  3997. },
  3998. {
  3999. "input": "../i",
  4000. "base": "sc:/pa/pa",
  4001. "href": "sc:/i",
  4002. "origin": "null",
  4003. "protocol": "sc:",
  4004. "username": "",
  4005. "password": "",
  4006. "host": "",
  4007. "hostname": "",
  4008. "port": "",
  4009. "pathname": "/i",
  4010. "search": "",
  4011. "hash": ""
  4012. },
  4013. {
  4014. "input": "../i",
  4015. "base": "sc://ho/pa",
  4016. "href": "sc://ho/i",
  4017. "origin": "null",
  4018. "protocol": "sc:",
  4019. "username": "",
  4020. "password": "",
  4021. "host": "ho",
  4022. "hostname": "ho",
  4023. "port": "",
  4024. "pathname": "/i",
  4025. "search": "",
  4026. "hash": ""
  4027. },
  4028. {
  4029. "input": "../i",
  4030. "base": "sc:///pa/pa",
  4031. "href": "sc:///i",
  4032. "origin": "null",
  4033. "protocol": "sc:",
  4034. "username": "",
  4035. "password": "",
  4036. "host": "",
  4037. "hostname": "",
  4038. "port": "",
  4039. "pathname": "/i",
  4040. "search": "",
  4041. "hash": ""
  4042. },
  4043. {
  4044. "input": "/i",
  4045. "base": "sc:sd",
  4046. "failure": true
  4047. },
  4048. {
  4049. "input": "/i",
  4050. "base": "sc:sd/sd",
  4051. "failure": true
  4052. },
  4053. {
  4054. "input": "/i",
  4055. "base": "sc:/pa/pa",
  4056. "href": "sc:/i",
  4057. "origin": "null",
  4058. "protocol": "sc:",
  4059. "username": "",
  4060. "password": "",
  4061. "host": "",
  4062. "hostname": "",
  4063. "port": "",
  4064. "pathname": "/i",
  4065. "search": "",
  4066. "hash": ""
  4067. },
  4068. {
  4069. "input": "/i",
  4070. "base": "sc://ho/pa",
  4071. "href": "sc://ho/i",
  4072. "origin": "null",
  4073. "protocol": "sc:",
  4074. "username": "",
  4075. "password": "",
  4076. "host": "ho",
  4077. "hostname": "ho",
  4078. "port": "",
  4079. "pathname": "/i",
  4080. "search": "",
  4081. "hash": ""
  4082. },
  4083. {
  4084. "input": "/i",
  4085. "base": "sc:///pa/pa",
  4086. "href": "sc:///i",
  4087. "origin": "null",
  4088. "protocol": "sc:",
  4089. "username": "",
  4090. "password": "",
  4091. "host": "",
  4092. "hostname": "",
  4093. "port": "",
  4094. "pathname": "/i",
  4095. "search": "",
  4096. "hash": ""
  4097. },
  4098. {
  4099. "input": "?i",
  4100. "base": "sc:sd",
  4101. "failure": true
  4102. },
  4103. {
  4104. "input": "?i",
  4105. "base": "sc:sd/sd",
  4106. "failure": true
  4107. },
  4108. {
  4109. "input": "?i",
  4110. "base": "sc:/pa/pa",
  4111. "href": "sc:/pa/pa?i",
  4112. "origin": "null",
  4113. "protocol": "sc:",
  4114. "username": "",
  4115. "password": "",
  4116. "host": "",
  4117. "hostname": "",
  4118. "port": "",
  4119. "pathname": "/pa/pa",
  4120. "search": "?i",
  4121. "hash": ""
  4122. },
  4123. {
  4124. "input": "?i",
  4125. "base": "sc://ho/pa",
  4126. "href": "sc://ho/pa?i",
  4127. "origin": "null",
  4128. "protocol": "sc:",
  4129. "username": "",
  4130. "password": "",
  4131. "host": "ho",
  4132. "hostname": "ho",
  4133. "port": "",
  4134. "pathname": "/pa",
  4135. "search": "?i",
  4136. "hash": ""
  4137. },
  4138. {
  4139. "input": "?i",
  4140. "base": "sc:///pa/pa",
  4141. "href": "sc:///pa/pa?i",
  4142. "origin": "null",
  4143. "protocol": "sc:",
  4144. "username": "",
  4145. "password": "",
  4146. "host": "",
  4147. "hostname": "",
  4148. "port": "",
  4149. "pathname": "/pa/pa",
  4150. "search": "?i",
  4151. "hash": ""
  4152. },
  4153. {
  4154. "input": "#i",
  4155. "base": "sc:sd",
  4156. "href": "sc:sd#i",
  4157. "origin": "null",
  4158. "protocol": "sc:",
  4159. "username": "",
  4160. "password": "",
  4161. "host": "",
  4162. "hostname": "",
  4163. "port": "",
  4164. "pathname": "sd",
  4165. "search": "",
  4166. "hash": "#i"
  4167. },
  4168. {
  4169. "input": "#i",
  4170. "base": "sc:sd/sd",
  4171. "href": "sc:sd/sd#i",
  4172. "origin": "null",
  4173. "protocol": "sc:",
  4174. "username": "",
  4175. "password": "",
  4176. "host": "",
  4177. "hostname": "",
  4178. "port": "",
  4179. "pathname": "sd/sd",
  4180. "search": "",
  4181. "hash": "#i"
  4182. },
  4183. {
  4184. "input": "#i",
  4185. "base": "sc:/pa/pa",
  4186. "href": "sc:/pa/pa#i",
  4187. "origin": "null",
  4188. "protocol": "sc:",
  4189. "username": "",
  4190. "password": "",
  4191. "host": "",
  4192. "hostname": "",
  4193. "port": "",
  4194. "pathname": "/pa/pa",
  4195. "search": "",
  4196. "hash": "#i"
  4197. },
  4198. {
  4199. "input": "#i",
  4200. "base": "sc://ho/pa",
  4201. "href": "sc://ho/pa#i",
  4202. "origin": "null",
  4203. "protocol": "sc:",
  4204. "username": "",
  4205. "password": "",
  4206. "host": "ho",
  4207. "hostname": "ho",
  4208. "port": "",
  4209. "pathname": "/pa",
  4210. "search": "",
  4211. "hash": "#i"
  4212. },
  4213. {
  4214. "input": "#i",
  4215. "base": "sc:///pa/pa",
  4216. "href": "sc:///pa/pa#i",
  4217. "origin": "null",
  4218. "protocol": "sc:",
  4219. "username": "",
  4220. "password": "",
  4221. "host": "",
  4222. "hostname": "",
  4223. "port": "",
  4224. "pathname": "/pa/pa",
  4225. "search": "",
  4226. "hash": "#i"
  4227. },
  4228. "# make sure that relative URL logic works on known typically non-relative schemes too",
  4229. {
  4230. "input": "about:/../",
  4231. "base": "about:blank",
  4232. "href": "about:/",
  4233. "origin": "null",
  4234. "protocol": "about:",
  4235. "username": "",
  4236. "password": "",
  4237. "host": "",
  4238. "hostname": "",
  4239. "port": "",
  4240. "pathname": "/",
  4241. "search": "",
  4242. "hash": ""
  4243. },
  4244. {
  4245. "input": "data:/../",
  4246. "base": "about:blank",
  4247. "href": "data:/",
  4248. "origin": "null",
  4249. "protocol": "data:",
  4250. "username": "",
  4251. "password": "",
  4252. "host": "",
  4253. "hostname": "",
  4254. "port": "",
  4255. "pathname": "/",
  4256. "search": "",
  4257. "hash": ""
  4258. },
  4259. {
  4260. "input": "javascript:/../",
  4261. "base": "about:blank",
  4262. "href": "javascript:/",
  4263. "origin": "null",
  4264. "protocol": "javascript:",
  4265. "username": "",
  4266. "password": "",
  4267. "host": "",
  4268. "hostname": "",
  4269. "port": "",
  4270. "pathname": "/",
  4271. "search": "",
  4272. "hash": ""
  4273. },
  4274. {
  4275. "input": "mailto:/../",
  4276. "base": "about:blank",
  4277. "href": "mailto:/",
  4278. "origin": "null",
  4279. "protocol": "mailto:",
  4280. "username": "",
  4281. "password": "",
  4282. "host": "",
  4283. "hostname": "",
  4284. "port": "",
  4285. "pathname": "/",
  4286. "search": "",
  4287. "hash": ""
  4288. },
  4289. "# unknown schemes and non-ASCII domains",
  4290. {
  4291. "input": "sc://ñ.test/",
  4292. "base": "about:blank",
  4293. "href": "sc://xn--ida.test/",
  4294. "origin": "null",
  4295. "protocol": "sc:",
  4296. "username": "",
  4297. "password": "",
  4298. "host": "xn--ida.test",
  4299. "hostname": "xn--ida.test",
  4300. "port": "",
  4301. "pathname": "/",
  4302. "search": "",
  4303. "hash": ""
  4304. },
  4305. "# unknown schemes and backslashes",
  4306. {
  4307. "input": "sc:\\../",
  4308. "base": "about:blank",
  4309. "href": "sc:\\../",
  4310. "origin": "null",
  4311. "protocol": "sc:",
  4312. "username": "",
  4313. "password": "",
  4314. "host": "",
  4315. "hostname": "",
  4316. "port": "",
  4317. "pathname": "\\../",
  4318. "search": "",
  4319. "hash": ""
  4320. },
  4321. "# unknown scheme with path looking like a password",
  4322. {
  4323. "input": "sc::a@example.net",
  4324. "base": "about:blank",
  4325. "href": "sc::a@example.net",
  4326. "origin": "null",
  4327. "protocol": "sc:",
  4328. "username": "",
  4329. "password": "",
  4330. "host": "",
  4331. "hostname": "",
  4332. "port": "",
  4333. "pathname": ":a@example.net",
  4334. "search": "",
  4335. "hash": ""
  4336. },
  4337. "# tests from jsdom/whatwg-url designed for code coverage",
  4338. {
  4339. "input": "http://127.0.0.1:10100/relative_import.html",
  4340. "base": "about:blank",
  4341. "href": "http://127.0.0.1:10100/relative_import.html",
  4342. "origin": "http://127.0.0.1:10100",
  4343. "protocol": "http:",
  4344. "username": "",
  4345. "password": "",
  4346. "host": "127.0.0.1:10100",
  4347. "hostname": "127.0.0.1",
  4348. "port": "10100",
  4349. "pathname": "/relative_import.html",
  4350. "search": "",
  4351. "hash": ""
  4352. },
  4353. {
  4354. "input": "http://facebook.com/?foo=%7B%22abc%22",
  4355. "base": "about:blank",
  4356. "href": "http://facebook.com/?foo=%7B%22abc%22",
  4357. "origin": "http://facebook.com",
  4358. "protocol": "http:",
  4359. "username": "",
  4360. "password": "",
  4361. "host": "facebook.com",
  4362. "hostname": "facebook.com",
  4363. "port": "",
  4364. "pathname": "/",
  4365. "search": "?foo=%7B%22abc%22",
  4366. "hash": ""
  4367. },
  4368. {
  4369. "input": "https://localhost:3000/jqueryui@1.2.3",
  4370. "base": "about:blank",
  4371. "href": "https://localhost:3000/jqueryui@1.2.3",
  4372. "origin": "https://localhost:3000",
  4373. "protocol": "https:",
  4374. "username": "",
  4375. "password": "",
  4376. "host": "localhost:3000",
  4377. "hostname": "localhost",
  4378. "port": "3000",
  4379. "pathname": "/jqueryui@1.2.3",
  4380. "search": "",
  4381. "hash": ""
  4382. },
  4383. "# tab/LF/CR",
  4384. {
  4385. "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",
  4386. "base": "about:blank",
  4387. "href": "http://host:9000/path?query#frag",
  4388. "origin": "http://host:9000",
  4389. "protocol": "http:",
  4390. "username": "",
  4391. "password": "",
  4392. "host": "host:9000",
  4393. "hostname": "host",
  4394. "port": "9000",
  4395. "pathname": "/path",
  4396. "search": "?query",
  4397. "hash": "#frag"
  4398. },
  4399. "# Stringification of URL.searchParams",
  4400. {
  4401. "input": "?a=b&c=d",
  4402. "base": "http://example.org/foo/bar",
  4403. "href": "http://example.org/foo/bar?a=b&c=d",
  4404. "origin": "http://example.org",
  4405. "protocol": "http:",
  4406. "username": "",
  4407. "password": "",
  4408. "host": "example.org",
  4409. "hostname": "example.org",
  4410. "port": "",
  4411. "pathname": "/foo/bar",
  4412. "search": "?a=b&c=d",
  4413. "searchParams": "a=b&c=d",
  4414. "hash": ""
  4415. },
  4416. {
  4417. "input": "??a=b&c=d",
  4418. "base": "http://example.org/foo/bar",
  4419. "href": "http://example.org/foo/bar??a=b&c=d",
  4420. "origin": "http://example.org",
  4421. "protocol": "http:",
  4422. "username": "",
  4423. "password": "",
  4424. "host": "example.org",
  4425. "hostname": "example.org",
  4426. "port": "",
  4427. "pathname": "/foo/bar",
  4428. "search": "??a=b&c=d",
  4429. "searchParams": "%3Fa=b&c=d",
  4430. "hash": ""
  4431. },
  4432. "# Scheme only",
  4433. {
  4434. "input": "http:",
  4435. "base": "http://example.org/foo/bar",
  4436. "href": "http://example.org/foo/bar",
  4437. "origin": "http://example.org",
  4438. "protocol": "http:",
  4439. "username": "",
  4440. "password": "",
  4441. "host": "example.org",
  4442. "hostname": "example.org",
  4443. "port": "",
  4444. "pathname": "/foo/bar",
  4445. "search": "",
  4446. "searchParams": "",
  4447. "hash": ""
  4448. },
  4449. {
  4450. "input": "http:",
  4451. "base": "https://example.org/foo/bar",
  4452. "failure": true
  4453. },
  4454. {
  4455. "input": "sc:",
  4456. "base": "https://example.org/foo/bar",
  4457. "href": "sc:",
  4458. "origin": "null",
  4459. "protocol": "sc:",
  4460. "username": "",
  4461. "password": "",
  4462. "host": "",
  4463. "hostname": "",
  4464. "port": "",
  4465. "pathname": "",
  4466. "search": "",
  4467. "searchParams": "",
  4468. "hash": ""
  4469. },
  4470. "# Percent encoding of fragments",
  4471. {
  4472. "input": "http://foo.bar/baz?qux#foo\bbar",
  4473. "base": "about:blank",
  4474. "href": "http://foo.bar/baz?qux#foo%08bar",
  4475. "origin": "http://foo.bar",
  4476. "protocol": "http:",
  4477. "username": "",
  4478. "password": "",
  4479. "host": "foo.bar",
  4480. "hostname": "foo.bar",
  4481. "port": "",
  4482. "pathname": "/baz",
  4483. "search": "?qux",
  4484. "searchParams": "",
  4485. "hash": "#foo%08bar"
  4486. },
  4487. "# IPv6 compression and serialization",
  4488. {
  4489. "input": "http://[fe80:cd00::1257:0:211e:729c]/",
  4490. "base": "about:blank",
  4491. "href": "http://[fe80:cd00::1257:0:211e:729c]/",
  4492. "origin": "http://[fe80:cd00::1257:0:211e:729c]",
  4493. "protocol": "http:",
  4494. "username": "",
  4495. "password": "",
  4496. "host": "[fe80:cd00::1257:0:211e:729c]",
  4497. "hostname": "[fe80:cd00::1257:0:211e:729c]",
  4498. "port": "",
  4499. "pathname": "/",
  4500. "search": "",
  4501. "searchParams": "",
  4502. "hash": ""
  4503. },
  4504. "# IPv6 compression and serialization: Compress sequences of two or more zeroes",
  4505. {
  4506. "input": "http://[fe80:cd00:0:0:1257:0:211e:729c]/",
  4507. "base": "about:blank",
  4508. "href": "http://[fe80:cd00::1257:0:211e:729c]/",
  4509. "origin": "http://[fe80:cd00::1257:0:211e:729c]",
  4510. "protocol": "http:",
  4511. "username": "",
  4512. "password": "",
  4513. "host": "[fe80:cd00::1257:0:211e:729c]",
  4514. "hostname": "[fe80:cd00::1257:0:211e:729c]",
  4515. "port": "",
  4516. "pathname": "/",
  4517. "search": "",
  4518. "searchParams": "",
  4519. "hash": ""
  4520. },
  4521. "# IPv6 compression and serialization: Compress longest sequence of zeroes",
  4522. {
  4523. "input": "http://[fe80:0:0:1257:0:0:0:cd00]/",
  4524. "base": "about:blank",
  4525. "href": "http://[fe80:0:0:1257::cd00]/",
  4526. "origin": "http://[fe80:0:0:1257::cd00]",
  4527. "protocol": "http:",
  4528. "username": "",
  4529. "password": "",
  4530. "host": "[fe80:0:0:1257::cd00]",
  4531. "hostname": "[fe80:0:0:1257::cd00]",
  4532. "port": "",
  4533. "pathname": "/",
  4534. "search": "",
  4535. "searchParams": "",
  4536. "hash": ""
  4537. },
  4538. "# IPv6 compression and serialization: Do not compress lone zeroes",
  4539. {
  4540. "input": "http://[fe80:cd00:0:cde:1257:0:211e:729c]/",
  4541. "base": "about:blank",
  4542. "href": "http://[fe80:cd00:0:cde:1257:0:211e:729c]/",
  4543. "origin": "http://[fe80:cd00:0:cde:1257:0:211e:729c]",
  4544. "protocol": "http:",
  4545. "username": "",
  4546. "password": "",
  4547. "host": "[fe80:cd00:0:cde:1257:0:211e:729c]",
  4548. "hostname": "[fe80:cd00:0:cde:1257:0:211e:729c]",
  4549. "port": "",
  4550. "pathname": "/",
  4551. "search": "",
  4552. "searchParams": "",
  4553. "hash": ""
  4554. }
  4555. ]