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

correctly update ContentLength for uncompressed response body #498

Merged
merged 2 commits into from
Mar 2, 2024
Merged
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion pkg/event_processor/http_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,15 @@ func (hr *HTTPResponse) Display() []byte {
log.Println(err)
break
}
gbuf, err := io.ReadAll(reader)
if err != nil {
log.Println(err)
break
}

hr.response.Body = io.NopCloser(bytes.NewReader(gbuf))
// gzip uncompressed success
hr.response.Body = reader
hr.response.ContentLength = int64(len(gbuf))
hr.packerType = PacketTypeGzip
defer reader.Close()
default:
Expand Down
Loading