Skip to content

Commit

Permalink
Remove trailing slashes of pathname (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
twam authored Jun 11, 2024
1 parent 740c5c8 commit 33463eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function connectSocket() {
var ws, loc = window.location;
var protocol = loc.protocol == "https:" ? "wss:" : "ws:"

ws = new WebSocket(protocol + "//" + loc.hostname + (loc.port ? ":" + loc.port : "") + loc.pathname + "/ws");
ws = new WebSocket(protocol + "//" + loc.hostname + (loc.port ? ":" + loc.port : "") + loc.pathname.replace(/\/$/, "") + "/ws");

ws.onerror = function(evt) {
ws.close();
Expand Down

0 comments on commit 33463eb

Please sign in to comment.