Skip to content

Commit

Permalink
livereload: Use text/javascript here, too
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Oct 26, 2022
1 parent 588710a commit 00ff161
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion livereload/livereload.go
Expand Up @@ -45,6 +45,7 @@ import (

_ "embed"

"github.com/gohugoio/hugo/media"
"github.com/gorilla/websocket"
)

Expand Down Expand Up @@ -144,7 +145,7 @@ func refreshPathForPort(s string, port int) {

// ServeJS serves the liverreload.js who's reference is injected into the page.
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())
}

Expand Down

0 comments on commit 00ff161

Please sign in to comment.