urltestdata.json 99 KB

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