Skip to content

Commit

Permalink
Fix parsing when zone index contains uppercase letters
Browse files Browse the repository at this point in the history
Fixes #82
  • Loading branch information
JamesMGreene authored and whitequark committed Aug 24, 2017
1 parent d677623 commit eb99551
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ipaddr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/ipaddr.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@
if (string.indexOf('::') !== string.lastIndexOf('::')) {
return null;
}
zoneId = (string.match(zoneIndex) || [])[0];
zoneId = (string.match(ipv6Regexes['zoneIndex']) || [])[0];
if (zoneId) {
zoneId = zoneId.substring(1);
string = string.replace(/%.+$/, '');
Expand Down
2 changes: 1 addition & 1 deletion src/ipaddr.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ expandIPv6 = (string, parts) ->
return null

# Remove zone index and save it for later
zoneId = (string.match(zoneIndex) || [])[0]
zoneId = (string.match(ipv6Regexes['zoneIndex']) || [])[0]
if zoneId
zoneId = zoneId.substring(1)
string = string.replace(/%.+$/, '')
Expand Down
Loading

0 comments on commit eb99551

Please sign in to comment.