livereload: Use text/javascript here, too

This commit is contained in:
Bjørn Erik Pedersen 2022-10-26 12:54:50 +02:00
parent 588710a7ac
commit 00ff161b67
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -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())
} }