]> git.cworth.org Git - lmno.games/commitdiff
Use an absolute path for the events API
authorCarl Worth <cworth@cworth.org>
Thu, 21 May 2020 17:24:31 +0000 (10:24 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 21 May 2020 17:24:31 +0000 (10:24 -0700)
Again, from a bug report where a user's browser was unable to fetch
this resource.

empires/game.js

index 896db8fe598498aac9f735db3731ede7646b461f..d3d34949cdf87fe1875893939962b600f527b11d 100644 (file)
@@ -57,7 +57,7 @@ function post_reset() {
   request.send();
 }
 
-const events = new EventSource("events");
+const events = new EventSource(window.location + "events");
 
 events.onerror = function(event) {
   if (event.target.readyState === EventSource.CLOSED) {