Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: flush writes to http response on every chunk #743

Merged
merged 4 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ This changelog keeps track of work items that have been completed and are ready
- **Operator**: Remove ScaledObject `name` & `app` custom labels ([#717](https://github.com/kedacore/http-add-on/issues/717))
- **Scaler**: Provide graceful shutdown for grpc server on SIGINT and SIGTERM ([#731](https://github.com/kedacore/http-add-on/issues/731))
- **Scaler**: remplement custom interceptor metrics ([#718](https://github.com/kedacore/http-add-on/issues/718))
- **Interceptor**: Add support for streaming responses ([#743](https://github.com/kedacore/http-add-on/issues/742))
Copy link
Member

@JorTurFer JorTurFer Sep 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Interceptor**: Add support for streaming responses ([#743](https://github.com/kedacore/http-add-on/issues/742))
- **Interceptor**: Add support for streaming responses ([#742](https://github.com/kedacore/http-add-on/issues/742))


### Deprecations

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
Loading