From a78dba5191c3f8638f8dedcea0e0ceed2121d801 Mon Sep 17 00:00:00 2001 From: yusing Date: Sat, 28 Sep 2024 11:55:26 +0800 Subject: [PATCH] added response message on invalid api request host --- internal/api/handler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/api/handler.go b/internal/api/handler.go index 4139842c..2e041181 100644 --- a/internal/api/handler.go +++ b/internal/api/handler.go @@ -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)