mirror of
https://github.com/Luzifer/ots.git
synced 2026-01-05 18:15:30 -05:00
fix: remove double-gzip-encoding from metrics endpoint
fixes #217 Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
3ceba030dc
commit
3f9f4ecd24
1 changed files with 8 additions and 1 deletions
9
main.go
9
main.go
|
|
@ -126,7 +126,7 @@ func main() {
|
|||
|
||||
api.Register(r.PathPrefix("/api").Subrouter())
|
||||
|
||||
r.Handle("/metrics", metrics.Handler()).
|
||||
r.Handle("/metrics", handleRemoveAcceptEncoding(metrics.Handler())).
|
||||
Methods(http.MethodGet).
|
||||
MatcherFunc(func(r *http.Request, _ *mux.RouteMatch) bool {
|
||||
return requestInSubnetList(r, cust.MetricsAllowedSubnets)
|
||||
|
|
@ -240,3 +240,10 @@ func handleIndex(w http.ResponseWriter, _ *http.Request) {
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
func handleRemoveAcceptEncoding(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
r.Header.Del("Accept-Encoding")
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue