Merge pull request #297 from alexmozzhakov/patch-2

Fix for domains that begin with localhost and 127.0.0.1
This commit is contained in:
yungtravla 2018-06-25 03:12:08 +10:00 committed by GitHub
commit c03a549c00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,7 +97,7 @@ func (p *HTTPProxy) doProxy(req *http.Request) bool {
}
for _, blacklisted := range blacklist {
if strings.HasPrefix(req.Host, blacklisted) {
if strings.Split(req.Host, ":")[0] == blacklisted {
log.Error("Got request with blacklisted host: %s", req.Host)
return false
}