Fix regex for IPv6

Only match strings which end with ::1

Fixes #830

Signed-off-by: Abhishek Chanda <abhishek.becs@gmail.com>
This commit is contained in:
Abhishek Chanda 2015-12-30 00:20:37 +05:30
parent 36293e4e58
commit 0ce2a2dba0
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ import (
)
// IPLocalhost is a regex patter for localhost IP address range.
const IPLocalhost = `((127\.([0-9]{1,3}\.){2}[0-9]{1,3})|(::1))`
const IPLocalhost = `((127\.([0-9]{1,3}\.){2}[0-9]{1,3})|(::1)$)`
var localhostIPRegexp = regexp.MustCompile(IPLocalhost)