Update url prefixer to ignore svgs
Co-authored-by: Brandon Farmer <bthesorceror@gmail.com>pull/10616/head
parent
317a7cbf59
commit
675b9a2625
|
@ -5,6 +5,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"regexp"
|
||||||
|
|
||||||
"github.com/influxdata/chronograf"
|
"github.com/influxdata/chronograf"
|
||||||
)
|
)
|
||||||
|
@ -83,6 +84,12 @@ func (up *URLPrefixer) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isSVG, _ := regexp.Match(".svg$", []byte(r.URL.String()))
|
||||||
|
if isSVG {
|
||||||
|
up.Next.ServeHTTP(rw, r)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// chunked transfer because we're modifying the response on the fly, so we
|
// chunked transfer because we're modifying the response on the fly, so we
|
||||||
// won't know the final content-length
|
// won't know the final content-length
|
||||||
rw.Header().Set("Connection", "Keep-Alive")
|
rw.Header().Set("Connection", "Keep-Alive")
|
||||||
|
|
Loading…
Reference in New Issue