diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-05-31 20:52:19 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-05-31 20:52:19 +0200 |
| commit | d8bdce51c336f3693121202402ee38ff3f12c0e2 (patch) | |
| tree | 1b57fff5b8c6034436cf18b21f28142b3d17762c /main.go | |
| parent | 8074ecbec4f0036bd887e31c1652961cbf7fc4a2 (diff) | |
| download | WRMS-d8bdce51c336f3693121202402ee38ff3f12c0e2.tar.gz WRMS-d8bdce51c336f3693121202402ee38ff3f12c0e2.zip | |
send bad request status if the websocket connection has a bad UUID cookie
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -208,11 +208,15 @@ func wsEndpoint(w http.ResponseWriter, r *http.Request) { uuidCookie, err := r.Cookie("UUID") if err != nil { llog.Error("websocket connection has no set UUID cookie") + http.Error(w, "websocket connection has no set UUID cookie", http.StatusBadRequest) + return } id, err := uuid.Parse(uuidCookie.Value) if err != nil { llog.Error("Invalid UUID set in cookie") + http.Error(w, "Invalid UUID set in cookie", http.StatusBadRequest) + return } defer func() { |
