Skip to content

Commit

Permalink
feat: flush writes to http response on every chunk (#743)
Browse files Browse the repository at this point in the history
Co-authored-by: Jorge Turrado <jorge.turrado@scrm.lidl>
  • Loading branch information
itayariel and JorTurFer authored Oct 4, 2023
1 parent 4670544 commit 0a1d1de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ This changelog keeps track of work items that have been completed and are ready

### Fixes

- **Interceptor**: fatal error: concurrent map iteration and map write ([#726](https://github.com/kedacore/http-add-on/issues/726))
- **Interceptor**: Add support for streaming responses ([#743](https://github.com/kedacore/http-add-on/issues/743))
- **Interceptor**: Fatal error: concurrent map iteration and map write ([#726](https://github.com/kedacore/http-add-on/issues/726))
- **Interceptor**: Keep original Host in the Host header ([#331](https://github.com/kedacore/http-add-on/issues/331))
- **Interceptor**: Provide graceful shutdown for http servers on SIGINT and SIGTERM ([#731](https://github.com/kedacore/http-add-on/issues/731))
- **Operator**: Remove ScaledObject `name` & `app` custom labels ([#717](https://github.com/kedacore/http-add-on/issues/717))
Expand Down
3 changes: 3 additions & 0 deletions interceptor/middleware/loggingresponsewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ func (lrw *loggingResponseWriter) Header() http.Header {

func (lrw *loggingResponseWriter) Write(bytes []byte) (int, error) {
n, err := lrw.downstreamResponseWriter.Write(bytes)
if f, ok := lrw.downstreamResponseWriter.(http.Flusher); ok {
f.Flush()
}

lrw.bytesWritten += n

Expand Down

0 comments on commit 0a1d1de

Please sign in to comment.