Soft'N'Design Software
/
projects
/
trivabble.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5902210
)
Don't force :trivabble in sse and ws URLs
author
Raphaël Jakse
<raphael.trivabble@jakse.fr>
Mon, 13 Apr 2020 08:25:30 +0000
(10:25 +0200)
committer
Raphaël Jakse
<raphael.trivabble@jakse.fr>
Mon, 13 Apr 2020 08:25:30 +0000
(10:25 +0200)
trivabble-server.js
patch
|
blob
|
blame
|
history
diff --git
a/trivabble-server.js
b/trivabble-server.js
index a97c87b045574ede6d3a3b214ba621dfa6f7c289..c6e9deff9cbe7a5bfc648eb58a23335e75b05573 100644
(file)
--- a/
trivabble-server.js
+++ b/
trivabble-server.js
@@
-973,7
+973,7
@@
function handleRequest(request, response) {
return;
}
- const sseMatch = request.url.match(/\/
:[^/]+\/
sse\/(?<data>[\s\S]+)$/u);
+ const sseMatch = request.url.match(/\/
(?::[^/]+\/)?
sse\/(?<data>[\s\S]+)$/u);
if (sseMatch) {
response.setHeader("Content-Type", "text/event-stream");
@@
-1025,7
+1025,7
@@
fs.readFile("games.backup.json", function (err, data) {
// socket.on("close", function () {});
- const webSocketMatch = request.url.match(/\/
:[^/]+\/
ws\/(?<data>[\s\S]+)$/u);
+ const webSocketMatch = request.url.match(/\/
(?::[^/]+\/)?
ws\/(?<data>[\s\S]+)$/u);
let decodedData;
try {