From b8ab91b0d3c4791d41776e8567cc832737bd968e Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Sun, 15 Jan 2023 21:37:04 +0800 Subject: [PATCH] Skip validating on empty http host config --- transport/internet/http/hub.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/internet/http/hub.go b/transport/internet/http/hub.go index 21223b82995..b41aac01d4d 100644 --- a/transport/internet/http/hub.go +++ b/transport/internet/http/hub.go @@ -58,7 +58,7 @@ func (fw flushWriter) Write(p []byte) (n int, err error) { func (l *Listener) ServeHTTP(writer http.ResponseWriter, request *http.Request) { host := request.Host - if !l.config.isValidHost(host) { + if len(l.config.Host) != 0 && !l.config.isValidHost(host) { writer.WriteHeader(404) return }