From 32f001744905c679c018fb02eb700e280aa58b32 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Wed, 17 Apr 2024 21:31:57 -0400 Subject: [PATCH] Add error log for ws host and path check --- transport/internet/websocket/hub.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/transport/internet/websocket/hub.go b/transport/internet/websocket/hub.go index 8a860c30..7889a77f 100644 --- a/transport/internet/websocket/hub.go +++ b/transport/internet/websocket/hub.go @@ -39,10 +39,12 @@ var upgrader = &websocket.Upgrader{ func (h *requestHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { if len(h.host) > 0 && request.Host != h.host { + newError("failed to validate host, request:", request.Host, "config:", h.host).WriteToLog() writer.WriteHeader(http.StatusNotFound) return } if request.URL.Path != h.path { + newError("failed to validate path, request:", request.URL.Path, "config:", h.path).WriteToLog() writer.WriteHeader(http.StatusNotFound) return }