Merge pull request #5622 from influxdata/5565/js_content_type

fix(windows): programtically assign text/javascript content type
pull/5624/head
Pavel Závora 2020-12-02 15:09:03 +01:00 committed by GitHub
commit 64ce0415b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -7,7 +7,7 @@
1. [#5616](https://github.com/influxdata/chronograf/pull/5616): AND not-equal conditions in the generated tickscript where filter. 1. [#5616](https://github.com/influxdata/chronograf/pull/5616): AND not-equal conditions in the generated tickscript where filter.
1. [#5618](https://github.com/influxdata/chronograf/pull/5618): Disable InfluxDB admin page if administration is not possible. 1. [#5618](https://github.com/influxdata/chronograf/pull/5618): Disable InfluxDB admin page if administration is not possible.
1. [#5619](https://github.com/influxdata/chronograf/pull/5619): Use token authentication against InfluxDB v2 sources. 1. [#5619](https://github.com/influxdata/chronograf/pull/5619): Use token authentication against InfluxDB v2 sources.
1. [#5622](https://github.com/influxdata/chronograf/pull/5622): Avoid blank screen on Windows.
### Features ### Features

6
dist/dist.go vendored
View File

@ -5,6 +5,7 @@ package dist
import ( import (
"fmt" "fmt"
"net/http" "net/http"
"strings"
assetfs "github.com/elazarl/go-bindata-assetfs" assetfs "github.com/elazarl/go-bindata-assetfs"
) )
@ -82,6 +83,11 @@ func (b *BindataAssets) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if err := b.addCacheHeaders(name, w); err != nil { if err := b.addCacheHeaders(name, w); err != nil {
return nil, err return nil, err
} }
// https://github.com/influxdata/chronograf/issues/5565
// workaround wrong .js content-type on windows
if strings.HasSuffix(name, ".js") {
w.Header().Set("Content-Type", "text/javascript")
}
return octets, nil return octets, nil
} }
var dir http.FileSystem = &assetfs.AssetFS{ var dir http.FileSystem = &assetfs.AssetFS{