summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-02-23 19:45:36 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-23 19:45:36 +0100
commitc79e5cb2c3eff0eed70a32a72fcb4d4e91cb6b35 (patch)
tree61af2171e7cc9db65e1377cf328f16ca3bae5b98
parent47446095ce57908dd4d83452a9430905e9fcc263 (diff)
downloadserver-c79e5cb2c3eff0eed70a32a72fcb4d4e91cb6b35.tar.gz
Escape role in websocket connection.
-rw-r--r--public/common/play.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/public/common/play.js b/public/common/play.js
index 02a415d..0ad8765 100644
--- a/public/common/play.js
+++ b/public/common/play.js
@@ -387,7 +387,7 @@ function connect_play() {
let protocol = (window.location.protocol === "http:") ? "ws" : "wss"
let seen = document.getElementById("log").children.length
- let url = `${protocol}://${window.location.host}/play-socket?title=${params.title_id}&game=${params.game_id}&role=${params.role}&seen=${seen}`
+ let url = `${protocol}://${window.location.host}/play-socket?title=${params.title_id}&game=${params.game_id}&role=${encodeURIComponent(params.role)}&seen=${seen}`
console.log("CONNECTING", url)
document.getElementById("prompt").textContent = "Connecting... "