diff options
author | Jordan <me@jordan.im> | 2023-12-16 17:41:01 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2023-12-16 17:41:01 -0700 |
commit | 7ecc048ae012a631bc3f0dcbd62f6190384ea0cd (patch) | |
tree | f8dd09feb67af740fb92d13c458e602f9bee8d45 /vendor/github.com/PuerkitoBio/purell | |
parent | a3dac1a28fdc9e42d85c4686858c64597cf1a15b (diff) | |
download | keep-7ecc048ae012a631bc3f0dcbd62f6190384ea0cd.tar.gz keep-7ecc048ae012a631bc3f0dcbd62f6190384ea0cd.zip |
Diffstat (limited to 'vendor/github.com/PuerkitoBio/purell')
-rw-r--r-- | vendor/github.com/PuerkitoBio/purell/purell.go | 2 |
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, ".") } } |