Ignore http 1.0 request host missing errors
This commit is contained in:
parent
e1f5866989
commit
7e0f0d9d11
1 changed files with 5 additions and 1 deletions
|
@ -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 {
|
||||
// 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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue