From 733fd0b590c6dbead1ef5f16f5b64c914b2a17cd Mon Sep 17 00:00:00 2001 From: heav Date: Tue, 15 Nov 2022 01:16:24 +0000 Subject: oops, path beeoid --- main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.lua b/main.lua index a1614ea..9673e28 100644 --- a/main.lua +++ b/main.lua @@ -22,14 +22,14 @@ function onstream(server, stream) end local path = head:get(":path") - if not path:sub(1,6) == "/room/" or #path < 7 then + if not path:sub(1,6) == "/room/" or not path:sub(#path-2,#path) == "/ws" or #path < 10 then local response = headers.new() response:append(":status", "404") stream:write_headers(response, false) stream:write_chunk("please access /room/(roomname).", true) return end - local room = path:sub(7,#path) + local room = path:sub(7,#path-3) ws:accept() logic.onsocket(ws,room) -- cgit v1.2.3