|
127 | 127 | same( mua( "?foo=1&bar=2#spaz", p5 ), "http://jqm.com/test.php?foo=1&bar=2#spaz", "query relative and fragment - absolute root" );
|
128 | 128 | });
|
129 | 129 |
|
| 130 | + // https://github.com/jquery/jquery-mobile/issues/2362 |
| 131 | + test( "ipv6 host support", function(){ |
| 132 | + // http://www.ietf.org/rfc/rfc2732.txt ipv6 examples for tests |
| 133 | + // most definitely not comprehensive |
| 134 | + var ipv6_1 = "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html", |
| 135 | + ipv6_2 = "http://[1080:0:0:0:8:800:200C:417A]/index.html", |
| 136 | + ipv6_3 = "http://[3ffe:2a00:100:7031::1]", |
| 137 | + ipv6_4 = "http://[1080::8:800:200C:417A]/foo", |
| 138 | + ipv6_5 = "http://[::192.9.5.5]/ipng", |
| 139 | + ipv6_6 = "http://[::FFFF:129.144.52.38]:80/index.html", |
| 140 | + ipv6_7 = "http://[2010:836B:4179::836B:4179]", |
| 141 | + fromIssue = "http://[3fff:cafe:babe::]:443/foo"; |
| 142 | + |
| 143 | + same( $.mobile.path.parseUrl(ipv6_1).host, "[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80"); |
| 144 | + same( $.mobile.path.parseUrl(ipv6_1).hostname, "[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]"); |
| 145 | + same( $.mobile.path.parseUrl(ipv6_2).host, "[1080:0:0:0:8:800:200C:417A]"); |
| 146 | + same( $.mobile.path.parseUrl(ipv6_3).host, "[3ffe:2a00:100:7031::1]"); |
| 147 | + same( $.mobile.path.parseUrl(ipv6_4).host, "[1080::8:800:200C:417A]"); |
| 148 | + same( $.mobile.path.parseUrl(ipv6_5).host, "[::192.9.5.5]"); |
| 149 | + same( $.mobile.path.parseUrl(ipv6_6).host, "[::FFFF:129.144.52.38]:80"); |
| 150 | + same( $.mobile.path.parseUrl(ipv6_6).hostname, "[::FFFF:129.144.52.38]"); |
| 151 | + same( $.mobile.path.parseUrl(ipv6_7).host, "[2010:836B:4179::836B:4179]"); |
| 152 | + same( $.mobile.path.parseUrl(fromIssue).host, "[3fff:cafe:babe::]:443"); |
| 153 | + same( $.mobile.path.parseUrl(fromIssue).hostname, "[3fff:cafe:babe::]"); |
| 154 | + }); |
| 155 | + |
130 | 156 | test( "path.clean is working properly", function(){
|
131 | 157 | var localroot = location.protocol + "//" + location.host + location.pathname,
|
132 | 158 | remoteroot = "http://google.com/",
|
|
0 commit comments