urltestdata.json 95 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277
  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://[2001::1]:80",
  845. "base": "http://example.org/foo/bar",
  846. "href": "http://[2001::1]/",
  847. "origin": "http://[2001::1]",
  848. "protocol": "http:",
  849. "username": "",
  850. "password": "",
  851. "host": "[2001::1]",
  852. "hostname": "[2001::1]",
  853. "port": "",
  854. "pathname": "/",
  855. "search": "",
  856. "hash": ""
  857. },
  858. {
  859. "input": "http:/example.com/",
  860. "base": "http://example.org/foo/bar",
  861. "href": "http://example.org/example.com/",
  862. "origin": "http://example.org",
  863. "protocol": "http:",
  864. "username": "",
  865. "password": "",
  866. "host": "example.org",
  867. "hostname": "example.org",
  868. "port": "",
  869. "pathname": "/example.com/",
  870. "search": "",
  871. "hash": ""
  872. },
  873. {
  874. "input": "ftp:/example.com/",
  875. "base": "http://example.org/foo/bar",
  876. "href": "ftp://example.com/",
  877. "origin": "ftp://example.com",
  878. "protocol": "ftp:",
  879. "username": "",
  880. "password": "",
  881. "host": "example.com",
  882. "hostname": "example.com",
  883. "port": "",
  884. "pathname": "/",
  885. "search": "",
  886. "hash": ""
  887. },
  888. {
  889. "input": "https:/example.com/",
  890. "base": "http://example.org/foo/bar",
  891. "href": "https://example.com/",
  892. "origin": "https://example.com",
  893. "protocol": "https:",
  894. "username": "",
  895. "password": "",
  896. "host": "example.com",
  897. "hostname": "example.com",
  898. "port": "",
  899. "pathname": "/",
  900. "search": "",
  901. "hash": ""
  902. },
  903. {
  904. "input": "madeupscheme:/example.com/",
  905. "base": "http://example.org/foo/bar",
  906. "href": "madeupscheme:/example.com/",
  907. "origin": "null",
  908. "protocol": "madeupscheme:",
  909. "username": "",
  910. "password": "",
  911. "host": "",
  912. "hostname": "",
  913. "port": "",
  914. "pathname": "/example.com/",
  915. "search": "",
  916. "hash": ""
  917. },
  918. {
  919. "input": "file:/example.com/",
  920. "base": "http://example.org/foo/bar",
  921. "href": "file:///example.com/",
  922. "protocol": "file:",
  923. "username": "",
  924. "password": "",
  925. "host": "",
  926. "hostname": "",
  927. "port": "",
  928. "pathname": "/example.com/",
  929. "search": "",
  930. "hash": ""
  931. },
  932. {
  933. "input": "ftps:/example.com/",
  934. "base": "http://example.org/foo/bar",
  935. "href": "ftps:/example.com/",
  936. "origin": "null",
  937. "protocol": "ftps:",
  938. "username": "",
  939. "password": "",
  940. "host": "",
  941. "hostname": "",
  942. "port": "",
  943. "pathname": "/example.com/",
  944. "search": "",
  945. "hash": ""
  946. },
  947. {
  948. "input": "gopher:/example.com/",
  949. "base": "http://example.org/foo/bar",
  950. "href": "gopher://example.com/",
  951. "origin": "gopher://example.com",
  952. "protocol": "gopher:",
  953. "username": "",
  954. "password": "",
  955. "host": "example.com",
  956. "hostname": "example.com",
  957. "port": "",
  958. "pathname": "/",
  959. "search": "",
  960. "hash": ""
  961. },
  962. {
  963. "input": "ws:/example.com/",
  964. "base": "http://example.org/foo/bar",
  965. "href": "ws://example.com/",
  966. "origin": "ws://example.com",
  967. "protocol": "ws:",
  968. "username": "",
  969. "password": "",
  970. "host": "example.com",
  971. "hostname": "example.com",
  972. "port": "",
  973. "pathname": "/",
  974. "search": "",
  975. "hash": ""
  976. },
  977. {
  978. "input": "wss:/example.com/",
  979. "base": "http://example.org/foo/bar",
  980. "href": "wss://example.com/",
  981. "origin": "wss://example.com",
  982. "protocol": "wss:",
  983. "username": "",
  984. "password": "",
  985. "host": "example.com",
  986. "hostname": "example.com",
  987. "port": "",
  988. "pathname": "/",
  989. "search": "",
  990. "hash": ""
  991. },
  992. {
  993. "input": "data:/example.com/",
  994. "base": "http://example.org/foo/bar",
  995. "href": "data:/example.com/",
  996. "origin": "null",
  997. "protocol": "data:",
  998. "username": "",
  999. "password": "",
  1000. "host": "",
  1001. "hostname": "",
  1002. "port": "",
  1003. "pathname": "/example.com/",
  1004. "search": "",
  1005. "hash": ""
  1006. },
  1007. {
  1008. "input": "javascript:/example.com/",
  1009. "base": "http://example.org/foo/bar",
  1010. "href": "javascript:/example.com/",
  1011. "origin": "null",
  1012. "protocol": "javascript:",
  1013. "username": "",
  1014. "password": "",
  1015. "host": "",
  1016. "hostname": "",
  1017. "port": "",
  1018. "pathname": "/example.com/",
  1019. "search": "",
  1020. "hash": ""
  1021. },
  1022. {
  1023. "input": "mailto:/example.com/",
  1024. "base": "http://example.org/foo/bar",
  1025. "href": "mailto:/example.com/",
  1026. "origin": "null",
  1027. "protocol": "mailto:",
  1028. "username": "",
  1029. "password": "",
  1030. "host": "",
  1031. "hostname": "",
  1032. "port": "",
  1033. "pathname": "/example.com/",
  1034. "search": "",
  1035. "hash": ""
  1036. },
  1037. {
  1038. "input": "http:example.com/",
  1039. "base": "http://example.org/foo/bar",
  1040. "href": "http://example.org/foo/example.com/",
  1041. "origin": "http://example.org",
  1042. "protocol": "http:",
  1043. "username": "",
  1044. "password": "",
  1045. "host": "example.org",
  1046. "hostname": "example.org",
  1047. "port": "",
  1048. "pathname": "/foo/example.com/",
  1049. "search": "",
  1050. "hash": ""
  1051. },
  1052. {
  1053. "input": "ftp:example.com/",
  1054. "base": "http://example.org/foo/bar",
  1055. "href": "ftp://example.com/",
  1056. "origin": "ftp://example.com",
  1057. "protocol": "ftp:",
  1058. "username": "",
  1059. "password": "",
  1060. "host": "example.com",
  1061. "hostname": "example.com",
  1062. "port": "",
  1063. "pathname": "/",
  1064. "search": "",
  1065. "hash": ""
  1066. },
  1067. {
  1068. "input": "https:example.com/",
  1069. "base": "http://example.org/foo/bar",
  1070. "href": "https://example.com/",
  1071. "origin": "https://example.com",
  1072. "protocol": "https:",
  1073. "username": "",
  1074. "password": "",
  1075. "host": "example.com",
  1076. "hostname": "example.com",
  1077. "port": "",
  1078. "pathname": "/",
  1079. "search": "",
  1080. "hash": ""
  1081. },
  1082. {
  1083. "input": "madeupscheme:example.com/",
  1084. "base": "http://example.org/foo/bar",
  1085. "href": "madeupscheme:example.com/",
  1086. "origin": "null",
  1087. "protocol": "madeupscheme:",
  1088. "username": "",
  1089. "password": "",
  1090. "host": "",
  1091. "hostname": "",
  1092. "port": "",
  1093. "pathname": "example.com/",
  1094. "search": "",
  1095. "hash": ""
  1096. },
  1097. {
  1098. "input": "ftps:example.com/",
  1099. "base": "http://example.org/foo/bar",
  1100. "href": "ftps:example.com/",
  1101. "origin": "null",
  1102. "protocol": "ftps:",
  1103. "username": "",
  1104. "password": "",
  1105. "host": "",
  1106. "hostname": "",
  1107. "port": "",
  1108. "pathname": "example.com/",
  1109. "search": "",
  1110. "hash": ""
  1111. },
  1112. {
  1113. "input": "gopher:example.com/",
  1114. "base": "http://example.org/foo/bar",
  1115. "href": "gopher://example.com/",
  1116. "origin": "gopher://example.com",
  1117. "protocol": "gopher:",
  1118. "username": "",
  1119. "password": "",
  1120. "host": "example.com",
  1121. "hostname": "example.com",
  1122. "port": "",
  1123. "pathname": "/",
  1124. "search": "",
  1125. "hash": ""
  1126. },
  1127. {
  1128. "input": "ws:example.com/",
  1129. "base": "http://example.org/foo/bar",
  1130. "href": "ws://example.com/",
  1131. "origin": "ws://example.com",
  1132. "protocol": "ws:",
  1133. "username": "",
  1134. "password": "",
  1135. "host": "example.com",
  1136. "hostname": "example.com",
  1137. "port": "",
  1138. "pathname": "/",
  1139. "search": "",
  1140. "hash": ""
  1141. },
  1142. {
  1143. "input": "wss:example.com/",
  1144. "base": "http://example.org/foo/bar",
  1145. "href": "wss://example.com/",
  1146. "origin": "wss://example.com",
  1147. "protocol": "wss:",
  1148. "username": "",
  1149. "password": "",
  1150. "host": "example.com",
  1151. "hostname": "example.com",
  1152. "port": "",
  1153. "pathname": "/",
  1154. "search": "",
  1155. "hash": ""
  1156. },
  1157. {
  1158. "input": "data:example.com/",
  1159. "base": "http://example.org/foo/bar",
  1160. "href": "data:example.com/",
  1161. "origin": "null",
  1162. "protocol": "data:",
  1163. "username": "",
  1164. "password": "",
  1165. "host": "",
  1166. "hostname": "",
  1167. "port": "",
  1168. "pathname": "example.com/",
  1169. "search": "",
  1170. "hash": ""
  1171. },
  1172. {
  1173. "input": "javascript:example.com/",
  1174. "base": "http://example.org/foo/bar",
  1175. "href": "javascript:example.com/",
  1176. "origin": "null",
  1177. "protocol": "javascript:",
  1178. "username": "",
  1179. "password": "",
  1180. "host": "",
  1181. "hostname": "",
  1182. "port": "",
  1183. "pathname": "example.com/",
  1184. "search": "",
  1185. "hash": ""
  1186. },
  1187. {
  1188. "input": "mailto:example.com/",
  1189. "base": "http://example.org/foo/bar",
  1190. "href": "mailto:example.com/",
  1191. "origin": "null",
  1192. "protocol": "mailto:",
  1193. "username": "",
  1194. "password": "",
  1195. "host": "",
  1196. "hostname": "",
  1197. "port": "",
  1198. "pathname": "example.com/",
  1199. "search": "",
  1200. "hash": ""
  1201. },
  1202. {
  1203. "input": "/a/b/c",
  1204. "base": "http://example.org/foo/bar",
  1205. "href": "http://example.org/a/b/c",
  1206. "origin": "http://example.org",
  1207. "protocol": "http:",
  1208. "username": "",
  1209. "password": "",
  1210. "host": "example.org",
  1211. "hostname": "example.org",
  1212. "port": "",
  1213. "pathname": "/a/b/c",
  1214. "search": "",
  1215. "hash": ""
  1216. },
  1217. {
  1218. "input": "/a/ /c",
  1219. "base": "http://example.org/foo/bar",
  1220. "href": "http://example.org/a/%20/c",
  1221. "origin": "http://example.org",
  1222. "protocol": "http:",
  1223. "username": "",
  1224. "password": "",
  1225. "host": "example.org",
  1226. "hostname": "example.org",
  1227. "port": "",
  1228. "pathname": "/a/%20/c",
  1229. "search": "",
  1230. "hash": ""
  1231. },
  1232. {
  1233. "input": "/a%2fc",
  1234. "base": "http://example.org/foo/bar",
  1235. "href": "http://example.org/a%2fc",
  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%2fc",
  1244. "search": "",
  1245. "hash": ""
  1246. },
  1247. {
  1248. "input": "/a/%2f/c",
  1249. "base": "http://example.org/foo/bar",
  1250. "href": "http://example.org/a/%2f/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/%2f/c",
  1259. "search": "",
  1260. "hash": ""
  1261. },
  1262. {
  1263. "input": "#β",
  1264. "base": "http://example.org/foo/bar",
  1265. "href": "http://example.org/foo/bar#β",
  1266. "origin": "http://example.org",
  1267. "protocol": "http:",
  1268. "username": "",
  1269. "password": "",
  1270. "host": "example.org",
  1271. "hostname": "example.org",
  1272. "port": "",
  1273. "pathname": "/foo/bar",
  1274. "search": "",
  1275. "hash": "#β"
  1276. },
  1277. {
  1278. "input": "data:text/html,test#test",
  1279. "base": "http://example.org/foo/bar",
  1280. "href": "data:text/html,test#test",
  1281. "origin": "null",
  1282. "protocol": "data:",
  1283. "username": "",
  1284. "password": "",
  1285. "host": "",
  1286. "hostname": "",
  1287. "port": "",
  1288. "pathname": "text/html,test",
  1289. "search": "",
  1290. "hash": "#test"
  1291. },
  1292. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
  1293. {
  1294. "input": "file:c:\\foo\\bar.html",
  1295. "base": "file:///tmp/mock/path",
  1296. "href": "file:///c:/foo/bar.html",
  1297. "protocol": "file:",
  1298. "username": "",
  1299. "password": "",
  1300. "host": "",
  1301. "hostname": "",
  1302. "port": "",
  1303. "pathname": "/c:/foo/bar.html",
  1304. "search": "",
  1305. "hash": ""
  1306. },
  1307. {
  1308. "input": " File:c|////foo\\bar.html",
  1309. "base": "file:///tmp/mock/path",
  1310. "href": "file:///c:////foo/bar.html",
  1311. "protocol": "file:",
  1312. "username": "",
  1313. "password": "",
  1314. "host": "",
  1315. "hostname": "",
  1316. "port": "",
  1317. "pathname": "/c:////foo/bar.html",
  1318. "search": "",
  1319. "hash": ""
  1320. },
  1321. {
  1322. "input": "C|/foo/bar",
  1323. "base": "file:///tmp/mock/path",
  1324. "href": "file:///C:/foo/bar",
  1325. "protocol": "file:",
  1326. "username": "",
  1327. "password": "",
  1328. "host": "",
  1329. "hostname": "",
  1330. "port": "",
  1331. "pathname": "/C:/foo/bar",
  1332. "search": "",
  1333. "hash": ""
  1334. },
  1335. {
  1336. "input": "/C|\\foo\\bar",
  1337. "base": "file:///tmp/mock/path",
  1338. "href": "file:///C:/foo/bar",
  1339. "protocol": "file:",
  1340. "username": "",
  1341. "password": "",
  1342. "host": "",
  1343. "hostname": "",
  1344. "port": "",
  1345. "pathname": "/C:/foo/bar",
  1346. "search": "",
  1347. "hash": ""
  1348. },
  1349. {
  1350. "input": "//C|/foo/bar",
  1351. "base": "file:///tmp/mock/path",
  1352. "href": "file:///C:/foo/bar",
  1353. "protocol": "file:",
  1354. "username": "",
  1355. "password": "",
  1356. "host": "",
  1357. "hostname": "",
  1358. "port": "",
  1359. "pathname": "/C:/foo/bar",
  1360. "search": "",
  1361. "hash": ""
  1362. },
  1363. {
  1364. "input": "//server/file",
  1365. "base": "file:///tmp/mock/path",
  1366. "href": "file://server/file",
  1367. "protocol": "file:",
  1368. "username": "",
  1369. "password": "",
  1370. "host": "server",
  1371. "hostname": "server",
  1372. "port": "",
  1373. "pathname": "/file",
  1374. "search": "",
  1375. "hash": ""
  1376. },
  1377. {
  1378. "input": "\\\\server\\file",
  1379. "base": "file:///tmp/mock/path",
  1380. "href": "file://server/file",
  1381. "protocol": "file:",
  1382. "username": "",
  1383. "password": "",
  1384. "host": "server",
  1385. "hostname": "server",
  1386. "port": "",
  1387. "pathname": "/file",
  1388. "search": "",
  1389. "hash": ""
  1390. },
  1391. {
  1392. "input": "/\\server/file",
  1393. "base": "file:///tmp/mock/path",
  1394. "href": "file://server/file",
  1395. "protocol": "file:",
  1396. "username": "",
  1397. "password": "",
  1398. "host": "server",
  1399. "hostname": "server",
  1400. "port": "",
  1401. "pathname": "/file",
  1402. "search": "",
  1403. "hash": ""
  1404. },
  1405. {
  1406. "input": "file:///foo/bar.txt",
  1407. "base": "file:///tmp/mock/path",
  1408. "href": "file:///foo/bar.txt",
  1409. "protocol": "file:",
  1410. "username": "",
  1411. "password": "",
  1412. "host": "",
  1413. "hostname": "",
  1414. "port": "",
  1415. "pathname": "/foo/bar.txt",
  1416. "search": "",
  1417. "hash": ""
  1418. },
  1419. {
  1420. "input": "file:///home/me",
  1421. "base": "file:///tmp/mock/path",
  1422. "href": "file:///home/me",
  1423. "protocol": "file:",
  1424. "username": "",
  1425. "password": "",
  1426. "host": "",
  1427. "hostname": "",
  1428. "port": "",
  1429. "pathname": "/home/me",
  1430. "search": "",
  1431. "hash": ""
  1432. },
  1433. {
  1434. "input": "//",
  1435. "base": "file:///tmp/mock/path",
  1436. "href": "file:///",
  1437. "protocol": "file:",
  1438. "username": "",
  1439. "password": "",
  1440. "host": "",
  1441. "hostname": "",
  1442. "port": "",
  1443. "pathname": "/",
  1444. "search": "",
  1445. "hash": ""
  1446. },
  1447. {
  1448. "input": "///",
  1449. "base": "file:///tmp/mock/path",
  1450. "href": "file:///",
  1451. "protocol": "file:",
  1452. "username": "",
  1453. "password": "",
  1454. "host": "",
  1455. "hostname": "",
  1456. "port": "",
  1457. "pathname": "/",
  1458. "search": "",
  1459. "hash": ""
  1460. },
  1461. {
  1462. "input": "///test",
  1463. "base": "file:///tmp/mock/path",
  1464. "href": "file:///test",
  1465. "protocol": "file:",
  1466. "username": "",
  1467. "password": "",
  1468. "host": "",
  1469. "hostname": "",
  1470. "port": "",
  1471. "pathname": "/test",
  1472. "search": "",
  1473. "hash": ""
  1474. },
  1475. {
  1476. "input": "file://test",
  1477. "base": "file:///tmp/mock/path",
  1478. "href": "file://test/",
  1479. "protocol": "file:",
  1480. "username": "",
  1481. "password": "",
  1482. "host": "test",
  1483. "hostname": "test",
  1484. "port": "",
  1485. "pathname": "/",
  1486. "search": "",
  1487. "hash": ""
  1488. },
  1489. {
  1490. "input": "file://localhost",
  1491. "base": "file:///tmp/mock/path",
  1492. "href": "file:///",
  1493. "protocol": "file:",
  1494. "username": "",
  1495. "password": "",
  1496. "host": "",
  1497. "hostname": "",
  1498. "port": "",
  1499. "pathname": "/",
  1500. "search": "",
  1501. "hash": ""
  1502. },
  1503. {
  1504. "input": "file://localhost/",
  1505. "base": "file:///tmp/mock/path",
  1506. "href": "file:///",
  1507. "protocol": "file:",
  1508. "username": "",
  1509. "password": "",
  1510. "host": "",
  1511. "hostname": "",
  1512. "port": "",
  1513. "pathname": "/",
  1514. "search": "",
  1515. "hash": ""
  1516. },
  1517. {
  1518. "input": "file://localhost/test",
  1519. "base": "file:///tmp/mock/path",
  1520. "href": "file:///test",
  1521. "protocol": "file:",
  1522. "username": "",
  1523. "password": "",
  1524. "host": "",
  1525. "hostname": "",
  1526. "port": "",
  1527. "pathname": "/test",
  1528. "search": "",
  1529. "hash": ""
  1530. },
  1531. {
  1532. "input": "test",
  1533. "base": "file:///tmp/mock/path",
  1534. "href": "file:///tmp/mock/test",
  1535. "protocol": "file:",
  1536. "username": "",
  1537. "password": "",
  1538. "host": "",
  1539. "hostname": "",
  1540. "port": "",
  1541. "pathname": "/tmp/mock/test",
  1542. "search": "",
  1543. "hash": ""
  1544. },
  1545. {
  1546. "input": "file:test",
  1547. "base": "file:///tmp/mock/path",
  1548. "href": "file:///tmp/mock/test",
  1549. "protocol": "file:",
  1550. "username": "",
  1551. "password": "",
  1552. "host": "",
  1553. "hostname": "",
  1554. "port": "",
  1555. "pathname": "/tmp/mock/test",
  1556. "search": "",
  1557. "hash": ""
  1558. },
  1559. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
  1560. {
  1561. "input": "http://example.com/././foo",
  1562. "base": "about:blank",
  1563. "href": "http://example.com/foo",
  1564. "origin": "http://example.com",
  1565. "protocol": "http:",
  1566. "username": "",
  1567. "password": "",
  1568. "host": "example.com",
  1569. "hostname": "example.com",
  1570. "port": "",
  1571. "pathname": "/foo",
  1572. "search": "",
  1573. "hash": ""
  1574. },
  1575. {
  1576. "input": "http://example.com/./.foo",
  1577. "base": "about:blank",
  1578. "href": "http://example.com/.foo",
  1579. "origin": "http://example.com",
  1580. "protocol": "http:",
  1581. "username": "",
  1582. "password": "",
  1583. "host": "example.com",
  1584. "hostname": "example.com",
  1585. "port": "",
  1586. "pathname": "/.foo",
  1587. "search": "",
  1588. "hash": ""
  1589. },
  1590. {
  1591. "input": "http://example.com/foo/.",
  1592. "base": "about:blank",
  1593. "href": "http://example.com/foo/",
  1594. "origin": "http://example.com",
  1595. "protocol": "http:",
  1596. "username": "",
  1597. "password": "",
  1598. "host": "example.com",
  1599. "hostname": "example.com",
  1600. "port": "",
  1601. "pathname": "/foo/",
  1602. "search": "",
  1603. "hash": ""
  1604. },
  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/bar/..",
  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/bar/../",
  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/..bar",
  1652. "base": "about:blank",
  1653. "href": "http://example.com/foo/..bar",
  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/..bar",
  1662. "search": "",
  1663. "hash": ""
  1664. },
  1665. {
  1666. "input": "http://example.com/foo/bar/../ton",
  1667. "base": "about:blank",
  1668. "href": "http://example.com/foo/ton",
  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/ton",
  1677. "search": "",
  1678. "hash": ""
  1679. },
  1680. {
  1681. "input": "http://example.com/foo/bar/../ton/../../a",
  1682. "base": "about:blank",
  1683. "href": "http://example.com/a",
  1684. "origin": "http://example.com",
  1685. "protocol": "http:",
  1686. "username": "",
  1687. "password": "",
  1688. "host": "example.com",
  1689. "hostname": "example.com",
  1690. "port": "",
  1691. "pathname": "/a",
  1692. "search": "",
  1693. "hash": ""
  1694. },
  1695. {
  1696. "input": "http://example.com/foo/../../..",
  1697. "base": "about:blank",
  1698. "href": "http://example.com/",
  1699. "origin": "http://example.com",
  1700. "protocol": "http:",
  1701. "username": "",
  1702. "password": "",
  1703. "host": "example.com",
  1704. "hostname": "example.com",
  1705. "port": "",
  1706. "pathname": "/",
  1707. "search": "",
  1708. "hash": ""
  1709. },
  1710. {
  1711. "input": "http://example.com/foo/../../../ton",
  1712. "base": "about:blank",
  1713. "href": "http://example.com/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": "/ton",
  1722. "search": "",
  1723. "hash": ""
  1724. },
  1725. {
  1726. "input": "http://example.com/foo/%2e",
  1727. "base": "about:blank",
  1728. "href": "http://example.com/foo/",
  1729. "origin": "http://example.com",
  1730. "protocol": "http:",
  1731. "username": "",
  1732. "password": "",
  1733. "host": "example.com",
  1734. "hostname": "example.com",
  1735. "port": "",
  1736. "pathname": "/foo/",
  1737. "search": "",
  1738. "hash": ""
  1739. },
  1740. {
  1741. "input": "http://example.com/foo/%2e%2",
  1742. "base": "about:blank",
  1743. "href": "http://example.com/foo/.%2",
  1744. "origin": "http://example.com",
  1745. "protocol": "http:",
  1746. "username": "",
  1747. "password": "",
  1748. "host": "example.com",
  1749. "hostname": "example.com",
  1750. "port": "",
  1751. "pathname": "/foo/.%2",
  1752. "search": "",
  1753. "hash": ""
  1754. },
  1755. {
  1756. "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
  1757. "base": "about:blank",
  1758. "href": "http://example.com/..bar",
  1759. "origin": "http://example.com",
  1760. "protocol": "http:",
  1761. "username": "",
  1762. "password": "",
  1763. "host": "example.com",
  1764. "hostname": "example.com",
  1765. "port": "",
  1766. "pathname": "/..bar",
  1767. "search": "",
  1768. "hash": ""
  1769. },
  1770. {
  1771. "input": "http://example.com////../..",
  1772. "base": "about:blank",
  1773. "href": "http://example.com//",
  1774. "origin": "http://example.com",
  1775. "protocol": "http:",
  1776. "username": "",
  1777. "password": "",
  1778. "host": "example.com",
  1779. "hostname": "example.com",
  1780. "port": "",
  1781. "pathname": "//",
  1782. "search": "",
  1783. "hash": ""
  1784. },
  1785. {
  1786. "input": "http://example.com/foo/bar//../..",
  1787. "base": "about:blank",
  1788. "href": "http://example.com/foo/",
  1789. "origin": "http://example.com",
  1790. "protocol": "http:",
  1791. "username": "",
  1792. "password": "",
  1793. "host": "example.com",
  1794. "hostname": "example.com",
  1795. "port": "",
  1796. "pathname": "/foo/",
  1797. "search": "",
  1798. "hash": ""
  1799. },
  1800. {
  1801. "input": "http://example.com/foo/bar//..",
  1802. "base": "about:blank",
  1803. "href": "http://example.com/foo/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": "/foo/bar/",
  1812. "search": "",
  1813. "hash": ""
  1814. },
  1815. {
  1816. "input": "http://example.com/foo",
  1817. "base": "about:blank",
  1818. "href": "http://example.com/foo",
  1819. "origin": "http://example.com",
  1820. "protocol": "http:",
  1821. "username": "",
  1822. "password": "",
  1823. "host": "example.com",
  1824. "hostname": "example.com",
  1825. "port": "",
  1826. "pathname": "/foo",
  1827. "search": "",
  1828. "hash": ""
  1829. },
  1830. {
  1831. "input": "http://example.com/%20foo",
  1832. "base": "about:blank",
  1833. "href": "http://example.com/%20foo",
  1834. "origin": "http://example.com",
  1835. "protocol": "http:",
  1836. "username": "",
  1837. "password": "",
  1838. "host": "example.com",
  1839. "hostname": "example.com",
  1840. "port": "",
  1841. "pathname": "/%20foo",
  1842. "search": "",
  1843. "hash": ""
  1844. },
  1845. {
  1846. "input": "http://example.com/foo%",
  1847. "base": "about:blank",
  1848. "href": "http://example.com/foo%",
  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%",
  1857. "search": "",
  1858. "hash": ""
  1859. },
  1860. {
  1861. "input": "http://example.com/foo%2",
  1862. "base": "about:blank",
  1863. "href": "http://example.com/foo%2",
  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%2",
  1872. "search": "",
  1873. "hash": ""
  1874. },
  1875. {
  1876. "input": "http://example.com/foo%2zbar",
  1877. "base": "about:blank",
  1878. "href": "http://example.com/foo%2zbar",
  1879. "origin": "http://example.com",
  1880. "protocol": "http:",
  1881. "username": "",
  1882. "password": "",
  1883. "host": "example.com",
  1884. "hostname": "example.com",
  1885. "port": "",
  1886. "pathname": "/foo%2zbar",
  1887. "search": "",
  1888. "hash": ""
  1889. },
  1890. {
  1891. "input": "http://example.com/foo%2©zbar",
  1892. "base": "about:blank",
  1893. "href": "http://example.com/foo%2%C3%82%C2%A9zbar",
  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%2%C3%82%C2%A9zbar",
  1902. "search": "",
  1903. "hash": ""
  1904. },
  1905. {
  1906. "input": "http://example.com/foo%41%7a",
  1907. "base": "about:blank",
  1908. "href": "http://example.com/foo%41%7a",
  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%41%7a",
  1917. "search": "",
  1918. "hash": ""
  1919. },
  1920. {
  1921. "input": "http://example.com/foo\t\u0091%91",
  1922. "base": "about:blank",
  1923. "href": "http://example.com/foo%C2%91%91",
  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%C2%91%91",
  1932. "search": "",
  1933. "hash": ""
  1934. },
  1935. {
  1936. "input": "http://example.com/foo%00%51",
  1937. "base": "about:blank",
  1938. "href": "http://example.com/foo%00%51",
  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%00%51",
  1947. "search": "",
  1948. "hash": ""
  1949. },
  1950. {
  1951. "input": "http://example.com/(%28:%3A%29)",
  1952. "base": "about:blank",
  1953. "href": "http://example.com/(%28:%3A%29)",
  1954. "origin": "http://example.com",
  1955. "protocol": "http:",
  1956. "username": "",
  1957. "password": "",
  1958. "host": "example.com",
  1959. "hostname": "example.com",
  1960. "port": "",
  1961. "pathname": "/(%28:%3A%29)",
  1962. "search": "",
  1963. "hash": ""
  1964. },
  1965. {
  1966. "input": "http://example.com/%3A%3a%3C%3c",
  1967. "base": "about:blank",
  1968. "href": "http://example.com/%3A%3a%3C%3c",
  1969. "origin": "http://example.com",
  1970. "protocol": "http:",
  1971. "username": "",
  1972. "password": "",
  1973. "host": "example.com",
  1974. "hostname": "example.com",
  1975. "port": "",
  1976. "pathname": "/%3A%3a%3C%3c",
  1977. "search": "",
  1978. "hash": ""
  1979. },
  1980. {
  1981. "input": "http://example.com/foo\tbar",
  1982. "base": "about:blank",
  1983. "href": "http://example.com/foobar",
  1984. "origin": "http://example.com",
  1985. "protocol": "http:",
  1986. "username": "",
  1987. "password": "",
  1988. "host": "example.com",
  1989. "hostname": "example.com",
  1990. "port": "",
  1991. "pathname": "/foobar",
  1992. "search": "",
  1993. "hash": ""
  1994. },
  1995. {
  1996. "input": "http://example.com\\\\foo\\\\bar",
  1997. "base": "about:blank",
  1998. "href": "http://example.com//foo//bar",
  1999. "origin": "http://example.com",
  2000. "protocol": "http:",
  2001. "username": "",
  2002. "password": "",
  2003. "host": "example.com",
  2004. "hostname": "example.com",
  2005. "port": "",
  2006. "pathname": "//foo//bar",
  2007. "search": "",
  2008. "hash": ""
  2009. },
  2010. {
  2011. "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2012. "base": "about:blank",
  2013. "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2014. "origin": "http://example.com",
  2015. "protocol": "http:",
  2016. "username": "",
  2017. "password": "",
  2018. "host": "example.com",
  2019. "hostname": "example.com",
  2020. "port": "",
  2021. "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2022. "search": "",
  2023. "hash": ""
  2024. },
  2025. {
  2026. "input": "http://example.com/@asdf%40",
  2027. "base": "about:blank",
  2028. "href": "http://example.com/@asdf%40",
  2029. "origin": "http://example.com",
  2030. "protocol": "http:",
  2031. "username": "",
  2032. "password": "",
  2033. "host": "example.com",
  2034. "hostname": "example.com",
  2035. "port": "",
  2036. "pathname": "/@asdf%40",
  2037. "search": "",
  2038. "hash": ""
  2039. },
  2040. {
  2041. "input": "http://example.com/你好你好",
  2042. "base": "about:blank",
  2043. "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2044. "origin": "http://example.com",
  2045. "protocol": "http:",
  2046. "username": "",
  2047. "password": "",
  2048. "host": "example.com",
  2049. "hostname": "example.com",
  2050. "port": "",
  2051. "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2052. "search": "",
  2053. "hash": ""
  2054. },
  2055. {
  2056. "input": "http://example.com/‥/foo",
  2057. "base": "about:blank",
  2058. "href": "http://example.com/%E2%80%A5/foo",
  2059. "origin": "http://example.com",
  2060. "protocol": "http:",
  2061. "username": "",
  2062. "password": "",
  2063. "host": "example.com",
  2064. "hostname": "example.com",
  2065. "port": "",
  2066. "pathname": "/%E2%80%A5/foo",
  2067. "search": "",
  2068. "hash": ""
  2069. },
  2070. {
  2071. "input": "http://example.com//foo",
  2072. "base": "about:blank",
  2073. "href": "http://example.com/%EF%BB%BF/foo",
  2074. "origin": "http://example.com",
  2075. "protocol": "http:",
  2076. "username": "",
  2077. "password": "",
  2078. "host": "example.com",
  2079. "hostname": "example.com",
  2080. "port": "",
  2081. "pathname": "/%EF%BB%BF/foo",
  2082. "search": "",
  2083. "hash": ""
  2084. },
  2085. {
  2086. "input": "http://example.com/‮/foo/‭/bar",
  2087. "base": "about:blank",
  2088. "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar",
  2089. "origin": "http://example.com",
  2090. "protocol": "http:",
  2091. "username": "",
  2092. "password": "",
  2093. "host": "example.com",
  2094. "hostname": "example.com",
  2095. "port": "",
  2096. "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
  2097. "search": "",
  2098. "hash": ""
  2099. },
  2100. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js",
  2101. {
  2102. "input": "http://www.google.com/foo?bar=baz#",
  2103. "base": "about:blank",
  2104. "href": "http://www.google.com/foo?bar=baz#",
  2105. "origin": "http://www.google.com",
  2106. "protocol": "http:",
  2107. "username": "",
  2108. "password": "",
  2109. "host": "www.google.com",
  2110. "hostname": "www.google.com",
  2111. "port": "",
  2112. "pathname": "/foo",
  2113. "search": "?bar=baz",
  2114. "hash": ""
  2115. },
  2116. {
  2117. "input": "http://www.google.com/foo?bar=baz# »",
  2118. "base": "about:blank",
  2119. "href": "http://www.google.com/foo?bar=baz# »",
  2120. "origin": "http://www.google.com",
  2121. "protocol": "http:",
  2122. "username": "",
  2123. "password": "",
  2124. "host": "www.google.com",
  2125. "hostname": "www.google.com",
  2126. "port": "",
  2127. "pathname": "/foo",
  2128. "search": "?bar=baz",
  2129. "hash": "# »"
  2130. },
  2131. {
  2132. "input": "data:test# »",
  2133. "base": "about:blank",
  2134. "href": "data:test# »",
  2135. "origin": "null",
  2136. "protocol": "data:",
  2137. "username": "",
  2138. "password": "",
  2139. "host": "",
  2140. "hostname": "",
  2141. "port": "",
  2142. "pathname": "test",
  2143. "search": "",
  2144. "hash": "# »"
  2145. },
  2146. {
  2147. "input": "http://[www.google.com]/",
  2148. "base": "about:blank",
  2149. "failure": true
  2150. },
  2151. {
  2152. "input": "http://www.google.com",
  2153. "base": "about:blank",
  2154. "href": "http://www.google.com/",
  2155. "origin": "http://www.google.com",
  2156. "protocol": "http:",
  2157. "username": "",
  2158. "password": "",
  2159. "host": "www.google.com",
  2160. "hostname": "www.google.com",
  2161. "port": "",
  2162. "pathname": "/",
  2163. "search": "",
  2164. "hash": ""
  2165. },
  2166. {
  2167. "input": "http://192.0x00A80001",
  2168. "base": "about:blank",
  2169. "href": "http://192.168.0.1/",
  2170. "origin": "http://192.168.0.1",
  2171. "protocol": "http:",
  2172. "username": "",
  2173. "password": "",
  2174. "host": "192.168.0.1",
  2175. "hostname": "192.168.0.1",
  2176. "port": "",
  2177. "pathname": "/",
  2178. "search": "",
  2179. "hash": ""
  2180. },
  2181. {
  2182. "input": "http://www/foo%2Ehtml",
  2183. "base": "about:blank",
  2184. "href": "http://www/foo.html",
  2185. "origin": "http://www",
  2186. "protocol": "http:",
  2187. "username": "",
  2188. "password": "",
  2189. "host": "www",
  2190. "hostname": "www",
  2191. "port": "",
  2192. "pathname": "/foo.html",
  2193. "search": "",
  2194. "hash": ""
  2195. },
  2196. {
  2197. "input": "http://www/foo/%2E/html",
  2198. "base": "about:blank",
  2199. "href": "http://www/foo/html",
  2200. "origin": "http://www",
  2201. "protocol": "http:",
  2202. "username": "",
  2203. "password": "",
  2204. "host": "www",
  2205. "hostname": "www",
  2206. "port": "",
  2207. "pathname": "/foo/html",
  2208. "search": "",
  2209. "hash": ""
  2210. },
  2211. {
  2212. "input": "http://user:pass@/",
  2213. "base": "about:blank",
  2214. "failure": true
  2215. },
  2216. {
  2217. "input": "http://%25DOMAIN:foobar@foodomain.com/",
  2218. "base": "about:blank",
  2219. "href": "http://%25DOMAIN:foobar@foodomain.com/",
  2220. "origin": "http://foodomain.com",
  2221. "protocol": "http:",
  2222. "username": "%25DOMAIN",
  2223. "password": "foobar",
  2224. "host": "foodomain.com",
  2225. "hostname": "foodomain.com",
  2226. "port": "",
  2227. "pathname": "/",
  2228. "search": "",
  2229. "hash": ""
  2230. },
  2231. {
  2232. "input": "http:\\\\www.google.com\\foo",
  2233. "base": "about:blank",
  2234. "href": "http://www.google.com/foo",
  2235. "origin": "http://www.google.com",
  2236. "protocol": "http:",
  2237. "username": "",
  2238. "password": "",
  2239. "host": "www.google.com",
  2240. "hostname": "www.google.com",
  2241. "port": "",
  2242. "pathname": "/foo",
  2243. "search": "",
  2244. "hash": ""
  2245. },
  2246. {
  2247. "input": "http://foo:80/",
  2248. "base": "about:blank",
  2249. "href": "http://foo/",
  2250. "origin": "http://foo",
  2251. "protocol": "http:",
  2252. "username": "",
  2253. "password": "",
  2254. "host": "foo",
  2255. "hostname": "foo",
  2256. "port": "",
  2257. "pathname": "/",
  2258. "search": "",
  2259. "hash": ""
  2260. },
  2261. {
  2262. "input": "http://foo:81/",
  2263. "base": "about:blank",
  2264. "href": "http://foo:81/",
  2265. "origin": "http://foo:81",
  2266. "protocol": "http:",
  2267. "username": "",
  2268. "password": "",
  2269. "host": "foo:81",
  2270. "hostname": "foo",
  2271. "port": "81",
  2272. "pathname": "/",
  2273. "search": "",
  2274. "hash": ""
  2275. },
  2276. {
  2277. "input": "httpa://foo:80/",
  2278. "base": "about:blank",
  2279. "href": "httpa://foo:80/",
  2280. "origin": "null",
  2281. "protocol": "httpa:",
  2282. "username": "",
  2283. "password": "",
  2284. "host": "foo:80",
  2285. "hostname": "foo",
  2286. "port": "80",
  2287. "pathname": "/",
  2288. "search": "",
  2289. "hash": ""
  2290. },
  2291. {
  2292. "input": "http://foo:-80/",
  2293. "base": "about:blank",
  2294. "failure": true
  2295. },
  2296. {
  2297. "input": "https://foo:443/",
  2298. "base": "about:blank",
  2299. "href": "https://foo/",
  2300. "origin": "https://foo",
  2301. "protocol": "https:",
  2302. "username": "",
  2303. "password": "",
  2304. "host": "foo",
  2305. "hostname": "foo",
  2306. "port": "",
  2307. "pathname": "/",
  2308. "search": "",
  2309. "hash": ""
  2310. },
  2311. {
  2312. "input": "https://foo:80/",
  2313. "base": "about:blank",
  2314. "href": "https://foo:80/",
  2315. "origin": "https://foo:80",
  2316. "protocol": "https:",
  2317. "username": "",
  2318. "password": "",
  2319. "host": "foo:80",
  2320. "hostname": "foo",
  2321. "port": "80",
  2322. "pathname": "/",
  2323. "search": "",
  2324. "hash": ""
  2325. },
  2326. {
  2327. "input": "ftp://foo:21/",
  2328. "base": "about:blank",
  2329. "href": "ftp://foo/",
  2330. "origin": "ftp://foo",
  2331. "protocol": "ftp:",
  2332. "username": "",
  2333. "password": "",
  2334. "host": "foo",
  2335. "hostname": "foo",
  2336. "port": "",
  2337. "pathname": "/",
  2338. "search": "",
  2339. "hash": ""
  2340. },
  2341. {
  2342. "input": "ftp://foo:80/",
  2343. "base": "about:blank",
  2344. "href": "ftp://foo:80/",
  2345. "origin": "ftp://foo:80",
  2346. "protocol": "ftp:",
  2347. "username": "",
  2348. "password": "",
  2349. "host": "foo:80",
  2350. "hostname": "foo",
  2351. "port": "80",
  2352. "pathname": "/",
  2353. "search": "",
  2354. "hash": ""
  2355. },
  2356. {
  2357. "input": "gopher://foo:70/",
  2358. "base": "about:blank",
  2359. "href": "gopher://foo/",
  2360. "origin": "gopher://foo",
  2361. "protocol": "gopher:",
  2362. "username": "",
  2363. "password": "",
  2364. "host": "foo",
  2365. "hostname": "foo",
  2366. "port": "",
  2367. "pathname": "/",
  2368. "search": "",
  2369. "hash": ""
  2370. },
  2371. {
  2372. "input": "gopher://foo:443/",
  2373. "base": "about:blank",
  2374. "href": "gopher://foo:443/",
  2375. "origin": "gopher://foo:443",
  2376. "protocol": "gopher:",
  2377. "username": "",
  2378. "password": "",
  2379. "host": "foo:443",
  2380. "hostname": "foo",
  2381. "port": "443",
  2382. "pathname": "/",
  2383. "search": "",
  2384. "hash": ""
  2385. },
  2386. {
  2387. "input": "ws://foo:80/",
  2388. "base": "about:blank",
  2389. "href": "ws://foo/",
  2390. "origin": "ws://foo",
  2391. "protocol": "ws:",
  2392. "username": "",
  2393. "password": "",
  2394. "host": "foo",
  2395. "hostname": "foo",
  2396. "port": "",
  2397. "pathname": "/",
  2398. "search": "",
  2399. "hash": ""
  2400. },
  2401. {
  2402. "input": "ws://foo:81/",
  2403. "base": "about:blank",
  2404. "href": "ws://foo:81/",
  2405. "origin": "ws://foo:81",
  2406. "protocol": "ws:",
  2407. "username": "",
  2408. "password": "",
  2409. "host": "foo:81",
  2410. "hostname": "foo",
  2411. "port": "81",
  2412. "pathname": "/",
  2413. "search": "",
  2414. "hash": ""
  2415. },
  2416. {
  2417. "input": "ws://foo:443/",
  2418. "base": "about:blank",
  2419. "href": "ws://foo:443/",
  2420. "origin": "ws://foo:443",
  2421. "protocol": "ws:",
  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:815/",
  2433. "base": "about:blank",
  2434. "href": "ws://foo:815/",
  2435. "origin": "ws://foo:815",
  2436. "protocol": "ws:",
  2437. "username": "",
  2438. "password": "",
  2439. "host": "foo:815",
  2440. "hostname": "foo",
  2441. "port": "815",
  2442. "pathname": "/",
  2443. "search": "",
  2444. "hash": ""
  2445. },
  2446. {
  2447. "input": "wss://foo:80/",
  2448. "base": "about:blank",
  2449. "href": "wss://foo:80/",
  2450. "origin": "wss://foo:80",
  2451. "protocol": "wss:",
  2452. "username": "",
  2453. "password": "",
  2454. "host": "foo:80",
  2455. "hostname": "foo",
  2456. "port": "80",
  2457. "pathname": "/",
  2458. "search": "",
  2459. "hash": ""
  2460. },
  2461. {
  2462. "input": "wss://foo:81/",
  2463. "base": "about:blank",
  2464. "href": "wss://foo:81/",
  2465. "origin": "wss://foo:81",
  2466. "protocol": "wss:",
  2467. "username": "",
  2468. "password": "",
  2469. "host": "foo:81",
  2470. "hostname": "foo",
  2471. "port": "81",
  2472. "pathname": "/",
  2473. "search": "",
  2474. "hash": ""
  2475. },
  2476. {
  2477. "input": "wss://foo:443/",
  2478. "base": "about:blank",
  2479. "href": "wss://foo/",
  2480. "origin": "wss://foo",
  2481. "protocol": "wss:",
  2482. "username": "",
  2483. "password": "",
  2484. "host": "foo",
  2485. "hostname": "foo",
  2486. "port": "",
  2487. "pathname": "/",
  2488. "search": "",
  2489. "hash": ""
  2490. },
  2491. {
  2492. "input": "wss://foo:815/",
  2493. "base": "about:blank",
  2494. "href": "wss://foo:815/",
  2495. "origin": "wss://foo:815",
  2496. "protocol": "wss:",
  2497. "username": "",
  2498. "password": "",
  2499. "host": "foo:815",
  2500. "hostname": "foo",
  2501. "port": "815",
  2502. "pathname": "/",
  2503. "search": "",
  2504. "hash": ""
  2505. },
  2506. {
  2507. "input": "http:/example.com/",
  2508. "base": "about:blank",
  2509. "href": "http://example.com/",
  2510. "origin": "http://example.com",
  2511. "protocol": "http:",
  2512. "username": "",
  2513. "password": "",
  2514. "host": "example.com",
  2515. "hostname": "example.com",
  2516. "port": "",
  2517. "pathname": "/",
  2518. "search": "",
  2519. "hash": ""
  2520. },
  2521. {
  2522. "input": "ftp:/example.com/",
  2523. "base": "about:blank",
  2524. "href": "ftp://example.com/",
  2525. "origin": "ftp://example.com",
  2526. "protocol": "ftp:",
  2527. "username": "",
  2528. "password": "",
  2529. "host": "example.com",
  2530. "hostname": "example.com",
  2531. "port": "",
  2532. "pathname": "/",
  2533. "search": "",
  2534. "hash": ""
  2535. },
  2536. {
  2537. "input": "https:/example.com/",
  2538. "base": "about:blank",
  2539. "href": "https://example.com/",
  2540. "origin": "https://example.com",
  2541. "protocol": "https:",
  2542. "username": "",
  2543. "password": "",
  2544. "host": "example.com",
  2545. "hostname": "example.com",
  2546. "port": "",
  2547. "pathname": "/",
  2548. "search": "",
  2549. "hash": ""
  2550. },
  2551. {
  2552. "input": "madeupscheme:/example.com/",
  2553. "base": "about:blank",
  2554. "href": "madeupscheme:/example.com/",
  2555. "origin": "null",
  2556. "protocol": "madeupscheme:",
  2557. "username": "",
  2558. "password": "",
  2559. "host": "",
  2560. "hostname": "",
  2561. "port": "",
  2562. "pathname": "/example.com/",
  2563. "search": "",
  2564. "hash": ""
  2565. },
  2566. {
  2567. "input": "file:/example.com/",
  2568. "base": "about:blank",
  2569. "href": "file:///example.com/",
  2570. "protocol": "file:",
  2571. "username": "",
  2572. "password": "",
  2573. "host": "",
  2574. "hostname": "",
  2575. "port": "",
  2576. "pathname": "/example.com/",
  2577. "search": "",
  2578. "hash": ""
  2579. },
  2580. {
  2581. "input": "ftps:/example.com/",
  2582. "base": "about:blank",
  2583. "href": "ftps:/example.com/",
  2584. "origin": "null",
  2585. "protocol": "ftps:",
  2586. "username": "",
  2587. "password": "",
  2588. "host": "",
  2589. "hostname": "",
  2590. "port": "",
  2591. "pathname": "/example.com/",
  2592. "search": "",
  2593. "hash": ""
  2594. },
  2595. {
  2596. "input": "gopher:/example.com/",
  2597. "base": "about:blank",
  2598. "href": "gopher://example.com/",
  2599. "origin": "gopher://example.com",
  2600. "protocol": "gopher:",
  2601. "username": "",
  2602. "password": "",
  2603. "host": "example.com",
  2604. "hostname": "example.com",
  2605. "port": "",
  2606. "pathname": "/",
  2607. "search": "",
  2608. "hash": ""
  2609. },
  2610. {
  2611. "input": "ws:/example.com/",
  2612. "base": "about:blank",
  2613. "href": "ws://example.com/",
  2614. "origin": "ws://example.com",
  2615. "protocol": "ws:",
  2616. "username": "",
  2617. "password": "",
  2618. "host": "example.com",
  2619. "hostname": "example.com",
  2620. "port": "",
  2621. "pathname": "/",
  2622. "search": "",
  2623. "hash": ""
  2624. },
  2625. {
  2626. "input": "wss:/example.com/",
  2627. "base": "about:blank",
  2628. "href": "wss://example.com/",
  2629. "origin": "wss://example.com",
  2630. "protocol": "wss:",
  2631. "username": "",
  2632. "password": "",
  2633. "host": "example.com",
  2634. "hostname": "example.com",
  2635. "port": "",
  2636. "pathname": "/",
  2637. "search": "",
  2638. "hash": ""
  2639. },
  2640. {
  2641. "input": "data:/example.com/",
  2642. "base": "about:blank",
  2643. "href": "data:/example.com/",
  2644. "origin": "null",
  2645. "protocol": "data:",
  2646. "username": "",
  2647. "password": "",
  2648. "host": "",
  2649. "hostname": "",
  2650. "port": "",
  2651. "pathname": "/example.com/",
  2652. "search": "",
  2653. "hash": ""
  2654. },
  2655. {
  2656. "input": "javascript:/example.com/",
  2657. "base": "about:blank",
  2658. "href": "javascript:/example.com/",
  2659. "origin": "null",
  2660. "protocol": "javascript:",
  2661. "username": "",
  2662. "password": "",
  2663. "host": "",
  2664. "hostname": "",
  2665. "port": "",
  2666. "pathname": "/example.com/",
  2667. "search": "",
  2668. "hash": ""
  2669. },
  2670. {
  2671. "input": "mailto:/example.com/",
  2672. "base": "about:blank",
  2673. "href": "mailto:/example.com/",
  2674. "origin": "null",
  2675. "protocol": "mailto:",
  2676. "username": "",
  2677. "password": "",
  2678. "host": "",
  2679. "hostname": "",
  2680. "port": "",
  2681. "pathname": "/example.com/",
  2682. "search": "",
  2683. "hash": ""
  2684. },
  2685. {
  2686. "input": "http:example.com/",
  2687. "base": "about:blank",
  2688. "href": "http://example.com/",
  2689. "origin": "http://example.com",
  2690. "protocol": "http:",
  2691. "username": "",
  2692. "password": "",
  2693. "host": "example.com",
  2694. "hostname": "example.com",
  2695. "port": "",
  2696. "pathname": "/",
  2697. "search": "",
  2698. "hash": ""
  2699. },
  2700. {
  2701. "input": "ftp:example.com/",
  2702. "base": "about:blank",
  2703. "href": "ftp://example.com/",
  2704. "origin": "ftp://example.com",
  2705. "protocol": "ftp:",
  2706. "username": "",
  2707. "password": "",
  2708. "host": "example.com",
  2709. "hostname": "example.com",
  2710. "port": "",
  2711. "pathname": "/",
  2712. "search": "",
  2713. "hash": ""
  2714. },
  2715. {
  2716. "input": "https:example.com/",
  2717. "base": "about:blank",
  2718. "href": "https://example.com/",
  2719. "origin": "https://example.com",
  2720. "protocol": "https:",
  2721. "username": "",
  2722. "password": "",
  2723. "host": "example.com",
  2724. "hostname": "example.com",
  2725. "port": "",
  2726. "pathname": "/",
  2727. "search": "",
  2728. "hash": ""
  2729. },
  2730. {
  2731. "input": "madeupscheme:example.com/",
  2732. "base": "about:blank",
  2733. "href": "madeupscheme:example.com/",
  2734. "origin": "null",
  2735. "protocol": "madeupscheme:",
  2736. "username": "",
  2737. "password": "",
  2738. "host": "",
  2739. "hostname": "",
  2740. "port": "",
  2741. "pathname": "example.com/",
  2742. "search": "",
  2743. "hash": ""
  2744. },
  2745. {
  2746. "input": "ftps:example.com/",
  2747. "base": "about:blank",
  2748. "href": "ftps:example.com/",
  2749. "origin": "null",
  2750. "protocol": "ftps:",
  2751. "username": "",
  2752. "password": "",
  2753. "host": "",
  2754. "hostname": "",
  2755. "port": "",
  2756. "pathname": "example.com/",
  2757. "search": "",
  2758. "hash": ""
  2759. },
  2760. {
  2761. "input": "gopher:example.com/",
  2762. "base": "about:blank",
  2763. "href": "gopher://example.com/",
  2764. "origin": "gopher://example.com",
  2765. "protocol": "gopher:",
  2766. "username": "",
  2767. "password": "",
  2768. "host": "example.com",
  2769. "hostname": "example.com",
  2770. "port": "",
  2771. "pathname": "/",
  2772. "search": "",
  2773. "hash": ""
  2774. },
  2775. {
  2776. "input": "ws:example.com/",
  2777. "base": "about:blank",
  2778. "href": "ws://example.com/",
  2779. "origin": "ws://example.com",
  2780. "protocol": "ws:",
  2781. "username": "",
  2782. "password": "",
  2783. "host": "example.com",
  2784. "hostname": "example.com",
  2785. "port": "",
  2786. "pathname": "/",
  2787. "search": "",
  2788. "hash": ""
  2789. },
  2790. {
  2791. "input": "wss:example.com/",
  2792. "base": "about:blank",
  2793. "href": "wss://example.com/",
  2794. "origin": "wss://example.com",
  2795. "protocol": "wss:",
  2796. "username": "",
  2797. "password": "",
  2798. "host": "example.com",
  2799. "hostname": "example.com",
  2800. "port": "",
  2801. "pathname": "/",
  2802. "search": "",
  2803. "hash": ""
  2804. },
  2805. {
  2806. "input": "data:example.com/",
  2807. "base": "about:blank",
  2808. "href": "data:example.com/",
  2809. "origin": "null",
  2810. "protocol": "data:",
  2811. "username": "",
  2812. "password": "",
  2813. "host": "",
  2814. "hostname": "",
  2815. "port": "",
  2816. "pathname": "example.com/",
  2817. "search": "",
  2818. "hash": ""
  2819. },
  2820. {
  2821. "input": "javascript:example.com/",
  2822. "base": "about:blank",
  2823. "href": "javascript:example.com/",
  2824. "origin": "null",
  2825. "protocol": "javascript:",
  2826. "username": "",
  2827. "password": "",
  2828. "host": "",
  2829. "hostname": "",
  2830. "port": "",
  2831. "pathname": "example.com/",
  2832. "search": "",
  2833. "hash": ""
  2834. },
  2835. {
  2836. "input": "mailto:example.com/",
  2837. "base": "about:blank",
  2838. "href": "mailto:example.com/",
  2839. "origin": "null",
  2840. "protocol": "mailto:",
  2841. "username": "",
  2842. "password": "",
  2843. "host": "",
  2844. "hostname": "",
  2845. "port": "",
  2846. "pathname": "example.com/",
  2847. "search": "",
  2848. "hash": ""
  2849. },
  2850. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html",
  2851. {
  2852. "input": "http:@www.example.com",
  2853. "base": "about:blank",
  2854. "href": "http://www.example.com/",
  2855. "origin": "http://www.example.com",
  2856. "protocol": "http:",
  2857. "username": "",
  2858. "password": "",
  2859. "host": "www.example.com",
  2860. "hostname": "www.example.com",
  2861. "port": "",
  2862. "pathname": "/",
  2863. "search": "",
  2864. "hash": ""
  2865. },
  2866. {
  2867. "input": "http:/@www.example.com",
  2868. "base": "about:blank",
  2869. "href": "http://www.example.com/",
  2870. "origin": "http://www.example.com",
  2871. "protocol": "http:",
  2872. "username": "",
  2873. "password": "",
  2874. "host": "www.example.com",
  2875. "hostname": "www.example.com",
  2876. "port": "",
  2877. "pathname": "/",
  2878. "search": "",
  2879. "hash": ""
  2880. },
  2881. {
  2882. "input": "http://@www.example.com",
  2883. "base": "about:blank",
  2884. "href": "http://www.example.com/",
  2885. "origin": "http://www.example.com",
  2886. "protocol": "http:",
  2887. "username": "",
  2888. "password": "",
  2889. "host": "www.example.com",
  2890. "hostname": "www.example.com",
  2891. "port": "",
  2892. "pathname": "/",
  2893. "search": "",
  2894. "hash": ""
  2895. },
  2896. {
  2897. "input": "http:a:b@www.example.com",
  2898. "base": "about:blank",
  2899. "href": "http://a:b@www.example.com/",
  2900. "origin": "http://www.example.com",
  2901. "protocol": "http:",
  2902. "username": "a",
  2903. "password": "b",
  2904. "host": "www.example.com",
  2905. "hostname": "www.example.com",
  2906. "port": "",
  2907. "pathname": "/",
  2908. "search": "",
  2909. "hash": ""
  2910. },
  2911. {
  2912. "input": "http:/a:b@www.example.com",
  2913. "base": "about:blank",
  2914. "href": "http://a:b@www.example.com/",
  2915. "origin": "http://www.example.com",
  2916. "protocol": "http:",
  2917. "username": "a",
  2918. "password": "b",
  2919. "host": "www.example.com",
  2920. "hostname": "www.example.com",
  2921. "port": "",
  2922. "pathname": "/",
  2923. "search": "",
  2924. "hash": ""
  2925. },
  2926. {
  2927. "input": "http://a:b@www.example.com",
  2928. "base": "about:blank",
  2929. "href": "http://a:b@www.example.com/",
  2930. "origin": "http://www.example.com",
  2931. "protocol": "http:",
  2932. "username": "a",
  2933. "password": "b",
  2934. "host": "www.example.com",
  2935. "hostname": "www.example.com",
  2936. "port": "",
  2937. "pathname": "/",
  2938. "search": "",
  2939. "hash": ""
  2940. },
  2941. {
  2942. "input": "http://@pple.com",
  2943. "base": "about:blank",
  2944. "href": "http://pple.com/",
  2945. "origin": "http://pple.com",
  2946. "protocol": "http:",
  2947. "username": "",
  2948. "password": "",
  2949. "host": "pple.com",
  2950. "hostname": "pple.com",
  2951. "port": "",
  2952. "pathname": "/",
  2953. "search": "",
  2954. "hash": ""
  2955. },
  2956. {
  2957. "input": "http::b@www.example.com",
  2958. "base": "about:blank",
  2959. "href": "http://:b@www.example.com/",
  2960. "origin": "http://www.example.com",
  2961. "protocol": "http:",
  2962. "username": "",
  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:/:b@www.example.com",
  2973. "base": "about:blank",
  2974. "href": "http://:b@www.example.com/",
  2975. "origin": "http://www.example.com",
  2976. "protocol": "http:",
  2977. "username": "",
  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://:b@www.example.com",
  2988. "base": "about:blank",
  2989. "href": "http://:b@www.example.com/",
  2990. "origin": "http://www.example.com",
  2991. "protocol": "http:",
  2992. "username": "",
  2993. "password": "b",
  2994. "host": "www.example.com",
  2995. "hostname": "www.example.com",
  2996. "port": "",
  2997. "pathname": "/",
  2998. "search": "",
  2999. "hash": ""
  3000. },
  3001. {
  3002. "input": "http:/:@/www.example.com",
  3003. "base": "about:blank",
  3004. "failure": true
  3005. },
  3006. {
  3007. "input": "http://user@/www.example.com",
  3008. "base": "about:blank",
  3009. "failure": true
  3010. },
  3011. {
  3012. "input": "http:@/www.example.com",
  3013. "base": "about:blank",
  3014. "failure": true
  3015. },
  3016. {
  3017. "input": "http:/@/www.example.com",
  3018. "base": "about:blank",
  3019. "failure": true
  3020. },
  3021. {
  3022. "input": "http://@/www.example.com",
  3023. "base": "about:blank",
  3024. "failure": true
  3025. },
  3026. {
  3027. "input": "https:@/www.example.com",
  3028. "base": "about:blank",
  3029. "failure": true
  3030. },
  3031. {
  3032. "input": "http:a:b@/www.example.com",
  3033. "base": "about:blank",
  3034. "failure": true
  3035. },
  3036. {
  3037. "input": "http:/a:b@/www.example.com",
  3038. "base": "about:blank",
  3039. "failure": true
  3040. },
  3041. {
  3042. "input": "http://a:b@/www.example.com",
  3043. "base": "about:blank",
  3044. "failure": true
  3045. },
  3046. {
  3047. "input": "http::@/www.example.com",
  3048. "base": "about:blank",
  3049. "failure": true
  3050. },
  3051. {
  3052. "input": "http:a:@www.example.com",
  3053. "base": "about:blank",
  3054. "href": "http://a:@www.example.com/",
  3055. "origin": "http://www.example.com",
  3056. "protocol": "http:",
  3057. "username": "a",
  3058. "password": "",
  3059. "host": "www.example.com",
  3060. "hostname": "www.example.com",
  3061. "port": "",
  3062. "pathname": "/",
  3063. "search": "",
  3064. "hash": ""
  3065. },
  3066. {
  3067. "input": "http:/a:@www.example.com",
  3068. "base": "about:blank",
  3069. "href": "http://a:@www.example.com/",
  3070. "origin": "http://www.example.com",
  3071. "protocol": "http:",
  3072. "username": "a",
  3073. "password": "",
  3074. "host": "www.example.com",
  3075. "hostname": "www.example.com",
  3076. "port": "",
  3077. "pathname": "/",
  3078. "search": "",
  3079. "hash": ""
  3080. },
  3081. {
  3082. "input": "http://a:@www.example.com",
  3083. "base": "about:blank",
  3084. "href": "http://a:@www.example.com/",
  3085. "origin": "http://www.example.com",
  3086. "protocol": "http:",
  3087. "username": "a",
  3088. "password": "",
  3089. "host": "www.example.com",
  3090. "hostname": "www.example.com",
  3091. "port": "",
  3092. "pathname": "/",
  3093. "search": "",
  3094. "hash": ""
  3095. },
  3096. {
  3097. "input": "http://www.@pple.com",
  3098. "base": "about:blank",
  3099. "href": "http://www.@pple.com/",
  3100. "origin": "http://pple.com",
  3101. "protocol": "http:",
  3102. "username": "www.",
  3103. "password": "",
  3104. "host": "pple.com",
  3105. "hostname": "pple.com",
  3106. "port": "",
  3107. "pathname": "/",
  3108. "search": "",
  3109. "hash": ""
  3110. },
  3111. {
  3112. "input": "http:@:www.example.com",
  3113. "base": "about:blank",
  3114. "failure": true
  3115. },
  3116. {
  3117. "input": "http:/@:www.example.com",
  3118. "base": "about:blank",
  3119. "failure": true
  3120. },
  3121. {
  3122. "input": "http://@:www.example.com",
  3123. "base": "about:blank",
  3124. "failure": true
  3125. },
  3126. {
  3127. "input": "http://:@www.example.com",
  3128. "base": "about:blank",
  3129. "href": "http://:@www.example.com/",
  3130. "origin": "http://www.example.com",
  3131. "protocol": "http:",
  3132. "username": "",
  3133. "password": "",
  3134. "host": "www.example.com",
  3135. "hostname": "www.example.com",
  3136. "port": "",
  3137. "pathname": "/",
  3138. "search": "",
  3139. "hash": ""
  3140. },
  3141. "# Others",
  3142. {
  3143. "input": "/",
  3144. "base": "http://www.example.com/test",
  3145. "href": "http://www.example.com/",
  3146. "origin": "http://www.example.com",
  3147. "protocol": "http:",
  3148. "username": "",
  3149. "password": "",
  3150. "host": "www.example.com",
  3151. "hostname": "www.example.com",
  3152. "port": "",
  3153. "pathname": "/",
  3154. "search": "",
  3155. "hash": ""
  3156. },
  3157. {
  3158. "input": "/test.txt",
  3159. "base": "http://www.example.com/test",
  3160. "href": "http://www.example.com/test.txt",
  3161. "origin": "http://www.example.com",
  3162. "protocol": "http:",
  3163. "username": "",
  3164. "password": "",
  3165. "host": "www.example.com",
  3166. "hostname": "www.example.com",
  3167. "port": "",
  3168. "pathname": "/test.txt",
  3169. "search": "",
  3170. "hash": ""
  3171. },
  3172. {
  3173. "input": ".",
  3174. "base": "http://www.example.com/test",
  3175. "href": "http://www.example.com/",
  3176. "origin": "http://www.example.com",
  3177. "protocol": "http:",
  3178. "username": "",
  3179. "password": "",
  3180. "host": "www.example.com",
  3181. "hostname": "www.example.com",
  3182. "port": "",
  3183. "pathname": "/",
  3184. "search": "",
  3185. "hash": ""
  3186. },
  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": "./test.txt",
  3219. "base": "http://www.example.com/test",
  3220. "href": "http://www.example.com/test.txt",
  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": "/test.txt",
  3229. "search": "",
  3230. "hash": ""
  3231. },
  3232. {
  3233. "input": "../test.txt",
  3234. "base": "http://www.example.com/test",
  3235. "href": "http://www.example.com/test.txt",
  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": "/test.txt",
  3244. "search": "",
  3245. "hash": ""
  3246. },
  3247. {
  3248. "input": "../aaa/test.txt",
  3249. "base": "http://www.example.com/test",
  3250. "href": "http://www.example.com/aaa/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": "/aaa/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/%E4%B8%AD/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": "/%E4%B8%AD/test.txt",
  3289. "search": "",
  3290. "hash": ""
  3291. },
  3292. {
  3293. "input": "http://www.example2.com",
  3294. "base": "http://www.example.com/test",
  3295. "href": "http://www.example2.com/",
  3296. "origin": "http://www.example2.com",
  3297. "protocol": "http:",
  3298. "username": "",
  3299. "password": "",
  3300. "host": "www.example2.com",
  3301. "hostname": "www.example2.com",
  3302. "port": "",
  3303. "pathname": "/",
  3304. "search": "",
  3305. "hash": ""
  3306. },
  3307. {
  3308. "input": "//www.example2.com",
  3309. "base": "http://www.example.com/test",
  3310. "href": "http://www.example2.com/",
  3311. "origin": "http://www.example2.com",
  3312. "protocol": "http:",
  3313. "username": "",
  3314. "password": "",
  3315. "host": "www.example2.com",
  3316. "hostname": "www.example2.com",
  3317. "port": "",
  3318. "pathname": "/",
  3319. "search": "",
  3320. "hash": ""
  3321. },
  3322. {
  3323. "input": "file:...",
  3324. "base": "http://www.example.com/test",
  3325. "href": "file:///...",
  3326. "protocol": "file:",
  3327. "username": "",
  3328. "password": "",
  3329. "host": "",
  3330. "hostname": "",
  3331. "port": "",
  3332. "pathname": "/...",
  3333. "search": "",
  3334. "hash": ""
  3335. },
  3336. {
  3337. "input": "file:..",
  3338. "base": "http://www.example.com/test",
  3339. "href": "file:///",
  3340. "protocol": "file:",
  3341. "username": "",
  3342. "password": "",
  3343. "host": "",
  3344. "hostname": "",
  3345. "port": "",
  3346. "pathname": "/",
  3347. "search": "",
  3348. "hash": ""
  3349. },
  3350. {
  3351. "input": "file:a",
  3352. "base": "http://www.example.com/test",
  3353. "href": "file:///a",
  3354. "protocol": "file:",
  3355. "username": "",
  3356. "password": "",
  3357. "host": "",
  3358. "hostname": "",
  3359. "port": "",
  3360. "pathname": "/a",
  3361. "search": "",
  3362. "hash": ""
  3363. },
  3364. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
  3365. "Basic canonicalization, uppercase should be converted to lowercase",
  3366. {
  3367. "input": "http://ExAmPlE.CoM",
  3368. "base": "http://other.com/",
  3369. "href": "http://example.com/",
  3370. "origin": "http://example.com",
  3371. "protocol": "http:",
  3372. "username": "",
  3373. "password": "",
  3374. "host": "example.com",
  3375. "hostname": "example.com",
  3376. "port": "",
  3377. "pathname": "/",
  3378. "search": "",
  3379. "hash": ""
  3380. },
  3381. {
  3382. "input": "http://example example.com",
  3383. "base": "http://other.com/",
  3384. "failure": true
  3385. },
  3386. {
  3387. "input": "http://Goo%20 goo%7C|.com",
  3388. "base": "http://other.com/",
  3389. "failure": true
  3390. },
  3391. {
  3392. "input": "http://[]",
  3393. "base": "http://other.com/",
  3394. "failure": true
  3395. },
  3396. {
  3397. "input": "http://[:]",
  3398. "base": "http://other.com/",
  3399. "failure": true
  3400. },
  3401. "U+3000 is mapped to U+0020 (space) which is disallowed",
  3402. {
  3403. "input": "http://GOO\u00a0\u3000goo.com",
  3404. "base": "http://other.com/",
  3405. "failure": true
  3406. },
  3407. "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",
  3408. {
  3409. "input": "http://GOO\u200b\u2060\ufeffgoo.com",
  3410. "base": "http://other.com/",
  3411. "href": "http://googoo.com/",
  3412. "origin": "http://googoo.com",
  3413. "protocol": "http:",
  3414. "username": "",
  3415. "password": "",
  3416. "host": "googoo.com",
  3417. "hostname": "googoo.com",
  3418. "port": "",
  3419. "pathname": "/",
  3420. "search": "",
  3421. "hash": ""
  3422. },
  3423. "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
  3424. {
  3425. "input": "http://www.foo。bar.com",
  3426. "base": "http://other.com/",
  3427. "href": "http://www.foo.bar.com/",
  3428. "origin": "http://www.foo.bar.com",
  3429. "protocol": "http:",
  3430. "username": "",
  3431. "password": "",
  3432. "host": "www.foo.bar.com",
  3433. "hostname": "www.foo.bar.com",
  3434. "port": "",
  3435. "pathname": "/",
  3436. "search": "",
  3437. "hash": ""
  3438. },
  3439. "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0",
  3440. {
  3441. "input": "http://\ufdd0zyx.com",
  3442. "base": "http://other.com/",
  3443. "failure": true
  3444. },
  3445. "This is the same as previous but escaped",
  3446. {
  3447. "input": "http://%ef%b7%90zyx.com",
  3448. "base": "http://other.com/",
  3449. "failure": true
  3450. },
  3451. "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.",
  3452. {
  3453. "input": "http://Go.com",
  3454. "base": "http://other.com/",
  3455. "href": "http://go.com/",
  3456. "origin": "http://go.com",
  3457. "protocol": "http:",
  3458. "username": "",
  3459. "password": "",
  3460. "host": "go.com",
  3461. "hostname": "go.com",
  3462. "port": "",
  3463. "pathname": "/",
  3464. "search": "",
  3465. "hash": ""
  3466. },
  3467. "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257",
  3468. {
  3469. "input": "http://%41.com",
  3470. "base": "http://other.com/",
  3471. "failure": true
  3472. },
  3473. {
  3474. "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com",
  3475. "base": "http://other.com/",
  3476. "failure": true
  3477. },
  3478. "...%00 in fullwidth should fail (also as escaped UTF-8 input)",
  3479. {
  3480. "input": "http://%00.com",
  3481. "base": "http://other.com/",
  3482. "failure": true
  3483. },
  3484. {
  3485. "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com",
  3486. "base": "http://other.com/",
  3487. "failure": true
  3488. },
  3489. "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
  3490. {
  3491. "input": "http://你好你好",
  3492. "base": "http://other.com/",
  3493. "href": "http://xn--6qqa088eba/",
  3494. "origin": "http://你好你好",
  3495. "protocol": "http:",
  3496. "username": "",
  3497. "password": "",
  3498. "host": "xn--6qqa088eba",
  3499. "hostname": "xn--6qqa088eba",
  3500. "port": "",
  3501. "pathname": "/",
  3502. "search": "",
  3503. "hash": ""
  3504. },
  3505. "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191",
  3506. {
  3507. "input": "http://%zz%66%a.com",
  3508. "base": "http://other.com/",
  3509. "failure": true
  3510. },
  3511. "If we get an invalid character that has been escaped.",
  3512. {
  3513. "input": "http://%25",
  3514. "base": "http://other.com/",
  3515. "failure": true
  3516. },
  3517. {
  3518. "input": "http://hello%00",
  3519. "base": "http://other.com/",
  3520. "failure": true
  3521. },
  3522. "Escaped numbers should be treated like IP addresses if they are.",
  3523. {
  3524. "input": "http://%30%78%63%30%2e%30%32%35%30.01",
  3525. "base": "http://other.com/",
  3526. "href": "http://192.168.0.1/",
  3527. "origin": "http://192.168.0.1",
  3528. "protocol": "http:",
  3529. "username": "",
  3530. "password": "",
  3531. "host": "192.168.0.1",
  3532. "hostname": "192.168.0.1",
  3533. "port": "",
  3534. "pathname": "/",
  3535. "search": "",
  3536. "hash": ""
  3537. },
  3538. {
  3539. "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e",
  3540. "base": "http://other.com/",
  3541. "href": "http://192.168.0.1/",
  3542. "origin": "http://192.168.0.1",
  3543. "protocol": "http:",
  3544. "username": "",
  3545. "password": "",
  3546. "host": "192.168.0.1",
  3547. "hostname": "192.168.0.1",
  3548. "port": "",
  3549. "pathname": "/",
  3550. "search": "",
  3551. "hash": ""
  3552. },
  3553. {
  3554. "input": "http://192.168.0.257",
  3555. "base": "http://other.com/",
  3556. "failure": true
  3557. },
  3558. "Invalid escaping should trigger the regular host error handling",
  3559. {
  3560. "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01",
  3561. "base": "http://other.com/",
  3562. "failure": true
  3563. },
  3564. "Something that isn't exactly an IP should get treated as a host and spaces escaped",
  3565. {
  3566. "input": "http://192.168.0.1 hello",
  3567. "base": "http://other.com/",
  3568. "failure": true
  3569. },
  3570. "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
  3571. {
  3572. "input": "http://0Xc0.0250.01",
  3573. "base": "http://other.com/",
  3574. "href": "http://192.168.0.1/",
  3575. "origin": "http://192.168.0.1",
  3576. "protocol": "http:",
  3577. "username": "",
  3578. "password": "",
  3579. "host": "192.168.0.1",
  3580. "hostname": "192.168.0.1",
  3581. "port": "",
  3582. "pathname": "/",
  3583. "search": "",
  3584. "hash": ""
  3585. },
  3586. "Broken IPv6",
  3587. {
  3588. "input": "http://[google.com]",
  3589. "base": "http://other.com/",
  3590. "failure": true
  3591. },
  3592. "Misc Unicode",
  3593. {
  3594. "input": "http://foo:💩@example.com/bar",
  3595. "base": "http://other.com/",
  3596. "href": "http://foo:%F0%9F%92%A9@example.com/bar",
  3597. "origin": "http://example.com",
  3598. "protocol": "http:",
  3599. "username": "foo",
  3600. "password": "%F0%9F%92%A9",
  3601. "host": "example.com",
  3602. "hostname": "example.com",
  3603. "port": "",
  3604. "pathname": "/bar",
  3605. "search": "",
  3606. "hash": ""
  3607. },
  3608. "# resolving a fragment against any scheme succeeds",
  3609. {
  3610. "input": "#",
  3611. "base": "test:test",
  3612. "href": "test:test#",
  3613. "origin": "null",
  3614. "protocol": "test:",
  3615. "username": "",
  3616. "password": "",
  3617. "host": "",
  3618. "hostname": "",
  3619. "port": "",
  3620. "pathname": "test",
  3621. "search": "",
  3622. "hash": ""
  3623. },
  3624. {
  3625. "input": "#x",
  3626. "base": "mailto:x@x.com",
  3627. "href": "mailto:x@x.com#x",
  3628. "origin": "null",
  3629. "protocol": "mailto:",
  3630. "username": "",
  3631. "password": "",
  3632. "host": "",
  3633. "hostname": "",
  3634. "port": "",
  3635. "pathname": "x@x.com",
  3636. "search": "",
  3637. "hash": "#x"
  3638. },
  3639. {
  3640. "input": "#x",
  3641. "base": "data:,",
  3642. "href": "data:,#x",
  3643. "origin": "null",
  3644. "protocol": "data:",
  3645. "username": "",
  3646. "password": "",
  3647. "host": "",
  3648. "hostname": "",
  3649. "port": "",
  3650. "pathname": ",",
  3651. "search": "",
  3652. "hash": "#x"
  3653. },
  3654. {
  3655. "input": "#x",
  3656. "base": "about:blank",
  3657. "href": "about:blank#x",
  3658. "origin": "null",
  3659. "protocol": "about:",
  3660. "username": "",
  3661. "password": "",
  3662. "host": "",
  3663. "hostname": "",
  3664. "port": "",
  3665. "pathname": "blank",
  3666. "search": "",
  3667. "hash": "#x"
  3668. },
  3669. {
  3670. "input": "#",
  3671. "base": "test:test?test",
  3672. "href": "test:test?test#",
  3673. "origin": "null",
  3674. "protocol": "test:",
  3675. "username": "",
  3676. "password": "",
  3677. "host": "",
  3678. "hostname": "",
  3679. "port": "",
  3680. "pathname": "test",
  3681. "search": "?test",
  3682. "hash": ""
  3683. },
  3684. "# multiple @ in authority state",
  3685. {
  3686. "input": "https://@test@test@example:800/",
  3687. "base": "http://doesnotmatter/",
  3688. "href": "https://%40test%40test@example:800/",
  3689. "origin": "https://example:800",
  3690. "protocol": "https:",
  3691. "username": "%40test%40test",
  3692. "password": "",
  3693. "host": "example:800",
  3694. "hostname": "example",
  3695. "port": "800",
  3696. "pathname": "/",
  3697. "search": "",
  3698. "hash": ""
  3699. },
  3700. {
  3701. "input": "https://@@@example",
  3702. "base": "http://doesnotmatter/",
  3703. "href": "https://%40%40@example/",
  3704. "origin": "https://example",
  3705. "protocol": "https:",
  3706. "username": "%40%40",
  3707. "password": "",
  3708. "host": "example",
  3709. "hostname": "example",
  3710. "port": "",
  3711. "pathname": "/",
  3712. "search": "",
  3713. "hash": ""
  3714. },
  3715. "non-az-09 characters",
  3716. {
  3717. "input": "http://`{}:`{}@h/`{}?`{}",
  3718. "base": "http://doesnotmatter/",
  3719. "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}",
  3720. "origin": "http://h",
  3721. "protocol": "http:",
  3722. "username": "%60%7B%7D",
  3723. "password": "%60%7B%7D",
  3724. "host": "h",
  3725. "hostname": "h",
  3726. "port": "",
  3727. "pathname": "/%60%7B%7D",
  3728. "search": "?`{}",
  3729. "hash": ""
  3730. },
  3731. "# Credentials in base",
  3732. {
  3733. "input": "/some/path",
  3734. "base": "http://user@example.org/smth",
  3735. "href": "http://user@example.org/some/path",
  3736. "origin": "http://example.org",
  3737. "protocol": "http:",
  3738. "username": "user",
  3739. "password": "",
  3740. "host": "example.org",
  3741. "hostname": "example.org",
  3742. "port": "",
  3743. "pathname": "/some/path",
  3744. "search": "",
  3745. "hash": ""
  3746. },
  3747. {
  3748. "input": "",
  3749. "base": "http://user:pass@example.org:21/smth",
  3750. "href": "http://user:pass@example.org:21/smth",
  3751. "origin": "http://example.org:21",
  3752. "protocol": "http:",
  3753. "username": "user",
  3754. "password": "pass",
  3755. "host": "example.org:21",
  3756. "hostname": "example.org",
  3757. "port": "21",
  3758. "pathname": "/smth",
  3759. "search": "",
  3760. "hash": ""
  3761. },
  3762. {
  3763. "input": "/some/path",
  3764. "base": "http://user:pass@example.org:21/smth",
  3765. "href": "http://user:pass@example.org:21/some/path",
  3766. "origin": "http://example.org:21",
  3767. "protocol": "http:",
  3768. "username": "user",
  3769. "password": "pass",
  3770. "host": "example.org:21",
  3771. "hostname": "example.org",
  3772. "port": "21",
  3773. "pathname": "/some/path",
  3774. "search": "",
  3775. "hash": ""
  3776. },
  3777. "# a set of tests designed by zcorpan for relative URLs with unknown schemes",
  3778. {
  3779. "input": "i",
  3780. "base": "sc:sd",
  3781. "failure": true
  3782. },
  3783. {
  3784. "input": "i",
  3785. "base": "sc:sd/sd",
  3786. "failure": true
  3787. },
  3788. {
  3789. "input": "i",
  3790. "base": "sc:/pa/pa",
  3791. "href": "sc:/pa/i",
  3792. "origin": "null",
  3793. "protocol": "sc:",
  3794. "username": "",
  3795. "password": "",
  3796. "host": "",
  3797. "hostname": "",
  3798. "port": "",
  3799. "pathname": "/pa/i",
  3800. "search": "",
  3801. "hash": ""
  3802. },
  3803. {
  3804. "input": "i",
  3805. "base": "sc://ho/pa",
  3806. "href": "sc://ho/i",
  3807. "origin": "null",
  3808. "protocol": "sc:",
  3809. "username": "",
  3810. "password": "",
  3811. "host": "ho",
  3812. "hostname": "ho",
  3813. "port": "",
  3814. "pathname": "/i",
  3815. "search": "",
  3816. "hash": ""
  3817. },
  3818. {
  3819. "input": "i",
  3820. "base": "sc:///pa/pa",
  3821. "href": "sc:///pa/i",
  3822. "origin": "null",
  3823. "protocol": "sc:",
  3824. "username": "",
  3825. "password": "",
  3826. "host": "",
  3827. "hostname": "",
  3828. "port": "",
  3829. "pathname": "/pa/i",
  3830. "search": "",
  3831. "hash": ""
  3832. },
  3833. {
  3834. "input": "../i",
  3835. "base": "sc:sd",
  3836. "failure": true
  3837. },
  3838. {
  3839. "input": "../i",
  3840. "base": "sc:sd/sd",
  3841. "failure": true
  3842. },
  3843. {
  3844. "input": "../i",
  3845. "base": "sc:/pa/pa",
  3846. "href": "sc:/i",
  3847. "origin": "null",
  3848. "protocol": "sc:",
  3849. "username": "",
  3850. "password": "",
  3851. "host": "",
  3852. "hostname": "",
  3853. "port": "",
  3854. "pathname": "/i",
  3855. "search": "",
  3856. "hash": ""
  3857. },
  3858. {
  3859. "input": "../i",
  3860. "base": "sc://ho/pa",
  3861. "href": "sc://ho/i",
  3862. "origin": "null",
  3863. "protocol": "sc:",
  3864. "username": "",
  3865. "password": "",
  3866. "host": "ho",
  3867. "hostname": "ho",
  3868. "port": "",
  3869. "pathname": "/i",
  3870. "search": "",
  3871. "hash": ""
  3872. },
  3873. {
  3874. "input": "../i",
  3875. "base": "sc:///pa/pa",
  3876. "href": "sc:///i",
  3877. "origin": "null",
  3878. "protocol": "sc:",
  3879. "username": "",
  3880. "password": "",
  3881. "host": "",
  3882. "hostname": "",
  3883. "port": "",
  3884. "pathname": "/i",
  3885. "search": "",
  3886. "hash": ""
  3887. },
  3888. {
  3889. "input": "/i",
  3890. "base": "sc:sd",
  3891. "failure": true
  3892. },
  3893. {
  3894. "input": "/i",
  3895. "base": "sc:sd/sd",
  3896. "failure": true
  3897. },
  3898. {
  3899. "input": "/i",
  3900. "base": "sc:/pa/pa",
  3901. "href": "sc:/i",
  3902. "origin": "null",
  3903. "protocol": "sc:",
  3904. "username": "",
  3905. "password": "",
  3906. "host": "",
  3907. "hostname": "",
  3908. "port": "",
  3909. "pathname": "/i",
  3910. "search": "",
  3911. "hash": ""
  3912. },
  3913. {
  3914. "input": "/i",
  3915. "base": "sc://ho/pa",
  3916. "href": "sc://ho/i",
  3917. "origin": "null",
  3918. "protocol": "sc:",
  3919. "username": "",
  3920. "password": "",
  3921. "host": "ho",
  3922. "hostname": "ho",
  3923. "port": "",
  3924. "pathname": "/i",
  3925. "search": "",
  3926. "hash": ""
  3927. },
  3928. {
  3929. "input": "/i",
  3930. "base": "sc:///pa/pa",
  3931. "href": "sc:///i",
  3932. "origin": "null",
  3933. "protocol": "sc:",
  3934. "username": "",
  3935. "password": "",
  3936. "host": "",
  3937. "hostname": "",
  3938. "port": "",
  3939. "pathname": "/i",
  3940. "search": "",
  3941. "hash": ""
  3942. },
  3943. {
  3944. "input": "?i",
  3945. "base": "sc:sd",
  3946. "failure": true
  3947. },
  3948. {
  3949. "input": "?i",
  3950. "base": "sc:sd/sd",
  3951. "failure": true
  3952. },
  3953. {
  3954. "input": "?i",
  3955. "base": "sc:/pa/pa",
  3956. "href": "sc:/pa/pa?i",
  3957. "origin": "null",
  3958. "protocol": "sc:",
  3959. "username": "",
  3960. "password": "",
  3961. "host": "",
  3962. "hostname": "",
  3963. "port": "",
  3964. "pathname": "/pa/pa",
  3965. "search": "?i",
  3966. "hash": ""
  3967. },
  3968. {
  3969. "input": "?i",
  3970. "base": "sc://ho/pa",
  3971. "href": "sc://ho/pa?i",
  3972. "origin": "null",
  3973. "protocol": "sc:",
  3974. "username": "",
  3975. "password": "",
  3976. "host": "ho",
  3977. "hostname": "ho",
  3978. "port": "",
  3979. "pathname": "/pa",
  3980. "search": "?i",
  3981. "hash": ""
  3982. },
  3983. {
  3984. "input": "?i",
  3985. "base": "sc:///pa/pa",
  3986. "href": "sc:///pa/pa?i",
  3987. "origin": "null",
  3988. "protocol": "sc:",
  3989. "username": "",
  3990. "password": "",
  3991. "host": "",
  3992. "hostname": "",
  3993. "port": "",
  3994. "pathname": "/pa/pa",
  3995. "search": "?i",
  3996. "hash": ""
  3997. },
  3998. {
  3999. "input": "#i",
  4000. "base": "sc:sd",
  4001. "href": "sc:sd#i",
  4002. "origin": "null",
  4003. "protocol": "sc:",
  4004. "username": "",
  4005. "password": "",
  4006. "host": "",
  4007. "hostname": "",
  4008. "port": "",
  4009. "pathname": "sd",
  4010. "search": "",
  4011. "hash": "#i"
  4012. },
  4013. {
  4014. "input": "#i",
  4015. "base": "sc:sd/sd",
  4016. "href": "sc:sd/sd#i",
  4017. "origin": "null",
  4018. "protocol": "sc:",
  4019. "username": "",
  4020. "password": "",
  4021. "host": "",
  4022. "hostname": "",
  4023. "port": "",
  4024. "pathname": "sd/sd",
  4025. "search": "",
  4026. "hash": "#i"
  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": "",
  4041. "hash": "#i"
  4042. },
  4043. {
  4044. "input": "#i",
  4045. "base": "sc://ho/pa",
  4046. "href": "sc://ho/pa#i",
  4047. "origin": "null",
  4048. "protocol": "sc:",
  4049. "username": "",
  4050. "password": "",
  4051. "host": "ho",
  4052. "hostname": "ho",
  4053. "port": "",
  4054. "pathname": "/pa",
  4055. "search": "",
  4056. "hash": "#i"
  4057. },
  4058. {
  4059. "input": "#i",
  4060. "base": "sc:///pa/pa",
  4061. "href": "sc:///pa/pa#i",
  4062. "origin": "null",
  4063. "protocol": "sc:",
  4064. "username": "",
  4065. "password": "",
  4066. "host": "",
  4067. "hostname": "",
  4068. "port": "",
  4069. "pathname": "/pa/pa",
  4070. "search": "",
  4071. "hash": "#i"
  4072. },
  4073. "# make sure that relative URL logic works on known typically non-relative schemes too",
  4074. {
  4075. "input": "about:/../",
  4076. "base": "about:blank",
  4077. "href": "about:/",
  4078. "origin": "null",
  4079. "protocol": "about:",
  4080. "username": "",
  4081. "password": "",
  4082. "host": "",
  4083. "hostname": "",
  4084. "port": "",
  4085. "pathname": "/",
  4086. "search": "",
  4087. "hash": ""
  4088. },
  4089. {
  4090. "input": "data:/../",
  4091. "base": "about:blank",
  4092. "href": "data:/",
  4093. "origin": "null",
  4094. "protocol": "data:",
  4095. "username": "",
  4096. "password": "",
  4097. "host": "",
  4098. "hostname": "",
  4099. "port": "",
  4100. "pathname": "/",
  4101. "search": "",
  4102. "hash": ""
  4103. },
  4104. {
  4105. "input": "javascript:/../",
  4106. "base": "about:blank",
  4107. "href": "javascript:/",
  4108. "origin": "null",
  4109. "protocol": "javascript:",
  4110. "username": "",
  4111. "password": "",
  4112. "host": "",
  4113. "hostname": "",
  4114. "port": "",
  4115. "pathname": "/",
  4116. "search": "",
  4117. "hash": ""
  4118. },
  4119. {
  4120. "input": "mailto:/../",
  4121. "base": "about:blank",
  4122. "href": "mailto:/",
  4123. "origin": "null",
  4124. "protocol": "mailto:",
  4125. "username": "",
  4126. "password": "",
  4127. "host": "",
  4128. "hostname": "",
  4129. "port": "",
  4130. "pathname": "/",
  4131. "search": "",
  4132. "hash": ""
  4133. },
  4134. "# unknown schemes and non-ASCII domains",
  4135. {
  4136. "input": "sc://ñ.test/",
  4137. "base": "about:blank",
  4138. "href": "sc://xn--ida.test/",
  4139. "origin": "null",
  4140. "protocol": "sc:",
  4141. "username": "",
  4142. "password": "",
  4143. "host": "xn--ida.test",
  4144. "hostname": "xn--ida.test",
  4145. "port": "",
  4146. "pathname": "/",
  4147. "search": "",
  4148. "hash": ""
  4149. },
  4150. "# unknown schemes and backslashes",
  4151. {
  4152. "input": "sc:\\../",
  4153. "base": "about:blank",
  4154. "href": "sc:\\../",
  4155. "origin": "null",
  4156. "protocol": "sc:",
  4157. "username": "",
  4158. "password": "",
  4159. "host": "",
  4160. "hostname": "",
  4161. "port": "",
  4162. "pathname": "\\../",
  4163. "search": "",
  4164. "hash": ""
  4165. },
  4166. "# unknown scheme with path looking like a password",
  4167. {
  4168. "input": "sc::a@example.net",
  4169. "base": "about:blank",
  4170. "href": "sc::a@example.net",
  4171. "origin": "null",
  4172. "protocol": "sc:",
  4173. "username": "",
  4174. "password": "",
  4175. "host": "",
  4176. "hostname": "",
  4177. "port": "",
  4178. "pathname": ":a@example.net",
  4179. "search": "",
  4180. "hash": ""
  4181. },
  4182. "# tests from jsdom/whatwg-url designed for code coverage",
  4183. {
  4184. "input": "http://127.0.0.1:10100/relative_import.html",
  4185. "base": "about:blank",
  4186. "href": "http://127.0.0.1:10100/relative_import.html",
  4187. "origin": "http://127.0.0.1:10100",
  4188. "protocol": "http:",
  4189. "username": "",
  4190. "password": "",
  4191. "host": "127.0.0.1:10100",
  4192. "hostname": "127.0.0.1",
  4193. "port": "10100",
  4194. "pathname": "/relative_import.html",
  4195. "search": "",
  4196. "hash": ""
  4197. },
  4198. {
  4199. "input": "http://facebook.com/?foo=%7B%22abc%22",
  4200. "base": "about:blank",
  4201. "href": "http://facebook.com/?foo=%7B%22abc%22",
  4202. "origin": "http://facebook.com",
  4203. "protocol": "http:",
  4204. "username": "",
  4205. "password": "",
  4206. "host": "facebook.com",
  4207. "hostname": "facebook.com",
  4208. "port": "",
  4209. "pathname": "/",
  4210. "search": "?foo=%7B%22abc%22",
  4211. "hash": ""
  4212. },
  4213. {
  4214. "input": "https://localhost:3000/jqueryui@1.2.3",
  4215. "base": "about:blank",
  4216. "href": "https://localhost:3000/jqueryui@1.2.3",
  4217. "origin": "https://localhost:3000",
  4218. "protocol": "https:",
  4219. "username": "",
  4220. "password": "",
  4221. "host": "localhost:3000",
  4222. "hostname": "localhost",
  4223. "port": "3000",
  4224. "pathname": "/jqueryui@1.2.3",
  4225. "search": "",
  4226. "hash": ""
  4227. },
  4228. "# tab/LF/CR",
  4229. {
  4230. "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",
  4231. "base": "about:blank",
  4232. "href": "http://host:9000/path?query#frag",
  4233. "origin": "http://host:9000",
  4234. "protocol": "http:",
  4235. "username": "",
  4236. "password": "",
  4237. "host": "host:9000",
  4238. "hostname": "host",
  4239. "port": "9000",
  4240. "pathname": "/path",
  4241. "search": "?query",
  4242. "hash": "#frag"
  4243. },
  4244. "# Stringification of URL.searchParams",
  4245. {
  4246. "input": "?a=b&c=d",
  4247. "base": "http://example.org/foo/bar",
  4248. "href": "http://example.org/foo/bar?a=b&c=d",
  4249. "origin": "http://example.org",
  4250. "protocol": "http:",
  4251. "username": "",
  4252. "password": "",
  4253. "host": "example.org",
  4254. "hostname": "example.org",
  4255. "port": "",
  4256. "pathname": "/foo/bar",
  4257. "search": "?a=b&c=d",
  4258. "searchParams": "a=b&c=d",
  4259. "hash": ""
  4260. },
  4261. {
  4262. "input": "??a=b&c=d",
  4263. "base": "http://example.org/foo/bar",
  4264. "href": "http://example.org/foo/bar??a=b&c=d",
  4265. "origin": "http://example.org",
  4266. "protocol": "http:",
  4267. "username": "",
  4268. "password": "",
  4269. "host": "example.org",
  4270. "hostname": "example.org",
  4271. "port": "",
  4272. "pathname": "/foo/bar",
  4273. "search": "??a=b&c=d",
  4274. "searchParams": "%3Fa=b&c=d",
  4275. "hash": ""
  4276. }
  4277. ]