summaryrefslogtreecommitdiffhomepage
path: root/livereload/livereload.go
diff options
context:
space:
mode:
Diffstat (limited to 'livereload/livereload.go')
-rw-r--r--livereload/livereload.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/livereload/livereload.go b/livereload/livereload.go
index 1b1546158..a47a7b687 100644
--- a/livereload/livereload.go
+++ b/livereload/livereload.go
@@ -15,6 +15,7 @@ package livereload
import (
"net/http"
+ "strings"
"github.com/gorilla/websocket"
)
@@ -44,7 +45,8 @@ func ForceRefresh() {
func RefreshPath(s string) {
// Tell livereload a file has changed - will force a hard refresh if not CSS or an image
- wsHub.broadcast <- []byte(`{"command":"reload","path":"` + s + "\"" + `,"originalPath":"","liveCSS":true,"liveImg":true}`)
+ url_path := strings.Replace(s, "\\", "/", -1) // If path has backslashes on Windows, make path work for URL
+ wsHub.broadcast <- []byte(`{"command":"reload","path":"` + url_path + "\"" + `,"originalPath":"","liveCSS":true,"liveImg":true}`)
}
func ServeJS(w http.ResponseWriter, r *http.Request) {