1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-15 00:15:00 +02:00

Implemented flushing interval (#23)

* Implemented flushing interval

When proxying streaming responses, it would not flush the response writer buffer until some seemingly random point (maybe the number of bytes?). This makes it flush every 1 second by default, but with a configurable interval.

* flushing CHANGELOG

* gofmt and goimports
This commit is contained in:
Steve Arch
2019-01-31 14:02:15 +00:00
committed by Joel Speed
parent 787d3da9d2
commit 01c5f5ae3b
6 changed files with 30 additions and 18 deletions

View File

@ -76,6 +76,12 @@ func (l *responseLogger) Size() int {
return l.size
}
func (l *responseLogger) Flush() {
if flusher, ok := l.w.(http.Flusher); ok {
flusher.Flush()
}
}
// logMessageData is the container for all values that are available as variables in the request logging format.
// All values are pre-formatted strings so it is easy to use them in the format string.
type logMessageData struct {