Skip to content

Commit aa297d5

Browse files
committed
fix(logging): stream decompressed response logs
Spool decompressed response bodies through temporary files so request logs keep the decoded payload without retaining large responses in memory. Add coverage for gzip success, fallback, newline handling, and temp file cleanup.
1 parent 92038f5 commit aa297d5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/logging/request_logger_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ func TestFileRequestLoggerLogRequestPreservesLeadingNewlineResponseSemantics(t *
158158
t.Fatalf("expected response section in log, got: %s", logContent)
159159
}
160160
responseSection := logContent[responseIndex:]
161-
if !strings.Contains(responseSection, "Content-Type: text/plain\n\nbody starts after exactly one blank line") {
161+
if !strings.Contains(responseSection, "\n\nbody starts after exactly one blank line") {
162162
t.Fatalf("expected response body to begin after exactly one blank line, got: %q", responseSection)
163163
}
164-
if strings.Contains(responseSection, "Content-Type: text/plain\n\n\nbody starts after exactly one blank line") {
164+
if strings.Contains(responseSection, "\n\n\nbody starts after exactly one blank line") {
165165
t.Fatalf("expected no extra blank line before response body, got: %q", responseSection)
166166
}
167167
assertNoTempFilesRemain(t, logsDir)

0 commit comments

Comments
 (0)