diff options
-rw-r--r-- | main.lua | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |