Skip to content
Merged
Changes from all 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
6 changes: 6 additions & 0 deletions pkg/middleware/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ func (lrw *loggingResponseWriter) WriteHeader(code int) {
lrw.ResponseWriter.WriteHeader(code)
}

func (lrw *loggingResponseWriter) Flush() {
if f, ok := lrw.ResponseWriter.(http.Flusher); ok {
f.Flush()
}
}
Comment on lines +127 to +131
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

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

The Flush method should include a comment documenting its purpose, similar to the WriteHeader method above it. This is especially important since it implements the http.Flusher interface and its silent failure behavior (when the underlying writer doesn't support flushing) should be documented.

Copilot uses AI. Check for mistakes.

func newLoggingResponseWriter(w http.ResponseWriter) *loggingResponseWriter {
// WriteHeader(int) is not called if our response implicitly returns 200 OK, so
// we default to that status code.
Expand Down