aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/PuerkitoBio/purell/purell.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/PuerkitoBio/purell/purell.go')
-rw-r--r--vendor/github.com/PuerkitoBio/purell/purell.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/vendor/github.com/PuerkitoBio/purell/purell.go b/vendor/github.com/PuerkitoBio/purell/purell.go
index 74c8272..3b086ce 100644
--- a/vendor/github.com/PuerkitoBio/purell/purell.go
+++ b/vendor/github.com/PuerkitoBio/purell/purell.go
@@ -86,6 +86,7 @@ var rxDWORDHost = regexp.MustCompile(`^(\d+)((?:\.+)?(?:\:\d*)?)$`)
var rxOctalHost = regexp.MustCompile(`^(0\d*)\.(0\d*)\.(0\d*)\.(0\d*)((?:\.+)?(?:\:\d*)?)$`)
var rxHexHost = regexp.MustCompile(`^0x([0-9A-Fa-f]+)((?:\.+)?(?:\:\d*)?)$`)
var rxHostDots = regexp.MustCompile(`^(.+?)(:\d+)?$`)
+var rxHostInteriorDots = regexp.MustCompile(`\.+`)
var rxEmptyPort = regexp.MustCompile(`:+$`)
// Map of flags to implementation function.
@@ -368,6 +369,7 @@ func removeUnncessaryHostDots(u *url.URL) {
u.Host += matches[2]
}
}
+ u.Host = rxHostInteriorDots.ReplaceAllString(u.Host, ".")
}
}