added response message on invalid api request host

This commit is contained in:
yusing 2024-09-28 11:55:26 +08:00
parent c7208c90c6
commit a78dba5191

View file

@ -44,6 +44,7 @@ func checkHost(f http.HandlerFunc) http.HandlerFunc {
if r.Host != common.APIHTTPAddr {
Logger.Warnf("invalid request to API server with host: %s, expected: %s", r.Host, common.APIHTTPAddr)
w.WriteHeader(http.StatusNotFound)
w.Write([]byte("invalid request"))
return
}
f(w, r)