mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-24 21:56:05 +02:00
livereload: Use text/javascript here, too
This commit is contained in:
@@ -45,6 +45,7 @@ import (
|
|||||||
|
|
||||||
_ "embed"
|
_ "embed"
|
||||||
|
|
||||||
|
"github.com/gohugoio/hugo/media"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -144,7 +145,7 @@ func refreshPathForPort(s string, port int) {
|
|||||||
|
|
||||||
// ServeJS serves the liverreload.js who's reference is injected into the page.
|
// ServeJS serves the liverreload.js who's reference is injected into the page.
|
||||||
func ServeJS(w http.ResponseWriter, r *http.Request) {
|
func ServeJS(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/javascript")
|
w.Header().Set("Content-Type", media.JavascriptType.Type())
|
||||||
w.Write(liveReloadJS())
|
w.Write(liveReloadJS())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user