From 13be09c510d8184abee83151d43424ffdd0d24d2 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Thu, 13 Sep 2018 12:07:21 +0200 Subject: [PATCH] misc: minor optimization to the http proxy code --- modules/http_proxy_base.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/http_proxy_base.go b/modules/http_proxy_base.go index 433a0b94..830d8639 100644 --- a/modules/http_proxy_base.go +++ b/modules/http_proxy_base.go @@ -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 }