urltestdata.json 103 KB

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