Skip to content

Commit

Permalink
Fix the js mime type (#1576)
Browse files Browse the repository at this point in the history
  • Loading branch information
Senyoret1 authored May 24, 2023
1 parent f9a42a7 commit f426b20
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/visor/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"errors"
"fmt"
"io"
"mime"
"net"
"net/http"
"os"
Expand Down Expand Up @@ -1458,6 +1459,11 @@ func initHypervisor(_ context.Context, v *Visor, log *logging.Logger) error {

// Serve HTTP(s).

// Needed to work with modern browsers when serving from windows, which need the correct mime type for javascript.
if err := mime.AddExtensionType(".js", "application/javascript"); err != nil {
log.Fatalln("Unable to register js mime type.")
}

v.log.WithField("addr", conf.HTTPAddr).
WithField("tls", conf.EnableTLS).
Info("Serving hypervisor...")
Expand Down

0 comments on commit f426b20

Please sign in to comment.