Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the js mime type #1576

Merged
merged 1 commit into from
May 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1450,6 +1451,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