misc: minor optimization to the http proxy code

This commit is contained in:
evilsocket 2018-09-13 12:07:21 +02:00
commit 13be09c510
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

View file

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