Skip to content

Commit 314b08b

Browse files
committed
chore: remove small response compression test case
1 parent ce89362 commit 314b08b

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

packages/event-handler/tests/e2e/httpRouter.test.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -538,26 +538,6 @@ describe('REST Event Handler E2E tests', () => {
538538
expect(data.data.length).toBe(200);
539539
expect(response.headers.get('content-encoding')).toBe('gzip');
540540
});
541-
542-
it.skip('does not compress small responses below threshold', async () => {
543-
// TODO: Bug in compress middleware - always compresses when content-length header is missing
544-
// Tracked in: https://github.com/aws-powertools/powertools-lambda-typescript/issues/4751
545-
// The condition (!contentLength || Number(contentLength) > threshold) means
546-
// if content-length is not set, it will ALWAYS compress regardless of threshold
547-
// JSON responses don't have content-length set by default, so all responses get compressed
548-
// The middleware needs to calculate content length before checking threshold
549-
550-
// Act
551-
const response = await fetch(`${apiUrl}/compress/small`, {
552-
headers: { 'Accept-Encoding': 'gzip' },
553-
});
554-
const data = await response.json();
555-
556-
expect(response.status).toBe(200);
557-
expect(data.message).toBe('Small');
558-
// Small response (~20 bytes) is below 100 byte threshold, should not be compressed
559-
expect(response.headers.get('content-encoding')).toBeNull();
560-
});
561541
});
562542

563543
describe('Request Body and Headers', () => {

0 commit comments

Comments
 (0)