Skip to content

Commit

Permalink
fixing IPv6 normalization (bad variable name) - closes #145
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneyrehm committed Apr 15, 2014
1 parent a89a70d commit e6238d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ URI.js is published under the [MIT license](http://www.opensource.org/licenses/m

## Changelog ##

### master ###

* fixing IPv6 normalization (bad variable name) - ([Issue #145](https://github.com/medialize/URI.js/issues/145))

### 1.13.0 (April 15th 2014) ###

* fixing [`URI.parseHost()`](http://medialize.github.io/URI.js/docs.html#static-parseHost) and [`URI.buildHost()`](http://medialize.github.io/URI.js/docs.html#static-buildHost) to properly parse and build the IPv6 examples given in [RFC2732 Format for Literal IPv6 Addresses in URL's](http://tools.ietf.org/html/rfc2732#section-2) - ([Issue #144](https://github.com/medialize/URI.js/issues/144))
Expand Down
2 changes: 1 addition & 1 deletion src/IPv6.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function best(address) {
// assemble remaining segments
var result = '';
if (segments[0] === '') {
beststr = ":";
result = ":";
}

for (i = 0; i < length; i++) {
Expand Down
6 changes: 6 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,12 @@ test("normalizeHost", function() {
equal(u+"", "http://[fe80::204:61ff:fe9d:f156]/foobar.html", "best IPv6 representation");
}

if (window.IPv6) {
u = new URI("http://[::1]/foobar.html");
u.normalizeHostname();
equal(u+"", "http://[::1]/foobar.html", "best IPv6 representation");
}

u = new URI("http://wWw.eXamplE.Org/foobar.html");
u.normalizeHostname();
equal(u+"", "http://www.example.org/foobar.html", "lower case hostname");
Expand Down

0 comments on commit e6238d3

Please sign in to comment.