From aabd2f33f17904578bb9d2db37589c8d4744a0ae Mon Sep 17 00:00:00 2001 From: Anton Kovalenko Date: Fri, 17 May 2024 16:09:05 +0300 Subject: [PATCH] Close connection for unknown peers --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index a6cc153..9112c49 100644 --- a/main.go +++ b/main.go @@ -196,6 +196,8 @@ func (h *Handler) ServeWebSocket(wsConn *websocket.Conn, rAddr string) { loc, ok := h.locations[uuid] if !ok { authLog.WithField("uuid", uuid).Error("unknown user") + wsConn.CloseNow() + return } else { authLog.WithField("uuid", uuid).Info("logged in") }