From 4dfc07089186f9c4c6a926a25fcadc447e5db02a Mon Sep 17 00:00:00 2001 From: mountain Date: Tue, 13 Aug 2024 16:30:42 +0900 Subject: [PATCH] =?UTF-8?q?=ED=97=A4=EB=8D=94=EC=97=90=20=EC=84=B8?= =?UTF-8?q?=EC=85=98=ED=82=A4=20=EC=97=86=EC=9C=BC=EB=A9=B4=20=EC=8B=A4?= =?UTF-8?q?=ED=8C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wshandler/wshandler.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wshandler/wshandler.go b/wshandler/wshandler.go index 375fce6..7bbf1d8 100644 --- a/wshandler/wshandler.go +++ b/wshandler/wshandler.go @@ -729,6 +729,11 @@ func (ws *WebsocketHandler) upgrade(w http.ResponseWriter, r *http.Request) { }() sk := r.Header.Get("AS-X-SESSION") + if len(sk) == 0 { + w.WriteHeader(http.StatusUnauthorized) + return + } + authinfo, err := ws.sessionConsumer.Query(sk) if err != nil { w.WriteHeader(http.StatusInternalServerError)