Skip to content

Commit 4aaab66

Browse files
fix(session-replay-browser): use WAF signature body in 413 E2E tests
The bisect-retry path is now only triggered for WAF 413s (body contains 'Payload exceeds'). Update the E2E test route mocks to return a proper WAF response body so the bisect-retry tests actually exercise the WAF code path rather than the immediate-drop non-WAF path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 889753c commit 4aaab66

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎packages/session-replay-browser/e2e/capture.spec.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,11 @@ test.describe('413 payload-too-large handling', () => {
13081308
callCount++;
13091309
if (callCount === 1) {
13101310
// Simulate the server rejecting the initial payload as too large
1311-
await route.fulfill({ status: 413, contentType: 'application/json', body: '{"code":413}' });
1311+
await route.fulfill({
1312+
status: 413,
1313+
contentType: 'application/json',
1314+
body: '{"error":"Payload exceeds the maximum allowed size of 10MB"}',
1315+
});
13121316
} else {
13131317
deliveredBodies.push(readRouteBody(route));
13141318
await route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(SR_API_SUCCESS) });
@@ -1339,7 +1343,11 @@ test.describe('413 payload-too-large handling', () => {
13391343
await page.route('https://api-sr.amplitude.com/**', async (route: Route) => {
13401344
callCount++;
13411345
if (callCount <= 2) {
1342-
await route.fulfill({ status: 413, contentType: 'application/json', body: '{"code":413}' });
1346+
await route.fulfill({
1347+
status: 413,
1348+
contentType: 'application/json',
1349+
body: '{"error":"Payload exceeds the maximum allowed size of 10MB"}',
1350+
});
13431351
} else {
13441352
deliveredBodies.push(readRouteBody(route));
13451353
await route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(SR_API_SUCCESS) });

0 commit comments

Comments
 (0)