From 7e0f0d9d117ece8ebd7acbbe0481decc8c50820d Mon Sep 17 00:00:00 2001 From: Daniel Tomcej Date: Tue, 13 Jul 2021 07:30:20 -0600 Subject: [PATCH] Ignore http 1.0 request host missing errors --- pkg/rules/rules.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/rules/rules.go b/pkg/rules/rules.go index 08b0ebaae..1634b6bcb 100644 --- a/pkg/rules/rules.go +++ b/pkg/rules/rules.go @@ -113,7 +113,11 @@ func host(route *mux.Route, hosts ...string) error { route.MatcherFunc(func(req *http.Request, _ *mux.RouteMatch) bool { reqHost := requestdecorator.GetCanonizedHost(req.Context()) if len(reqHost) == 0 { - log.FromContext(req.Context()).Warnf("Could not retrieve CanonizedHost, rejecting %s", req.Host) + // If the request is an HTTP/1.0 request, then a Host may not be defined. + if req.ProtoAtLeast(1, 1) { + log.FromContext(req.Context()).Warnf("Could not retrieve CanonizedHost, rejecting %s", req.Host) + } + return false }