Added regex
This commit is contained in:
parent
3a2704011c
commit
1fefb44b51
4 changed files with 47 additions and 6 deletions
|
@ -31,7 +31,7 @@ app.get("/", (_, res) => {
|
|||
})
|
||||
|
||||
app.post("/", (req, res) => {
|
||||
if (rooms[req.body.room] != null) {
|
||||
if (!req.body.room.trim() || rooms[req.body.room]) {
|
||||
return res.redirect("/")
|
||||
}
|
||||
rooms[req.body.room] = { users: {} }
|
||||
|
|
Reference in a new issue