Skip to content

Commit

Permalink
Fix lint - Try 2
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandezBenjamin committed Nov 8, 2023
1 parent 415159f commit 306e7e2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,19 +364,19 @@ func newServer(ctx context.Context, c Config, rotationStrategy rotationStrategy)
})
}

// Buffer size middleware
bufferSizeMidldleware := func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
pw := bufio.NewWriterSize(w, 4096*2)
if pw.Buffered() > 0{
// Buffer size middleware
bufferSizeMidldleware := func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
pw := bufio.NewWriterSize(w, 4096*2)
if pw.Buffered() > 0 {
pw.Flush()
}
next.ServeHTTP(w, r)
})
}
next.ServeHTTP(w, r)
})
}

r := mux.NewRouter().SkipClean(true).UseEncodedPath()
r.Use(bufferSizeMidldleware)
r := mux.NewRouter().SkipClean(true).UseEncodedPath()
r.Use(bufferSizeMidldleware)
r.Use(frameAncestorsMidldleware)
handle := func(p string, h http.Handler) {
r.Handle(path.Join(issuerURL.Path, p), instrumentHandlerCounter(p, h))
Expand Down

0 comments on commit 306e7e2

Please sign in to comment.