diff options
author | heav <hheav3@gmail.com> | 2022-11-15 01:16:24 +0000 |
---|---|---|
committer | heav <hheav3@gmail.com> | 2022-11-15 01:16:24 +0000 |
commit | 733fd0b590c6dbead1ef5f16f5b64c914b2a17cd (patch) | |
tree | a88b5032a9514158bc63a5c2d2f441c1c52a169c | |
parent | 2b9763237e45737dc75feb27cacd12be8f78e64c (diff) |
oops, path beeoid
-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) |