inject_response_corruption
Intercept requests and corrupt responses with malformed JSON, false content-length, or truncation to verify resilient error handling.
Instructions
Intercepts requests matching a URL pattern and returns a malformed or corrupted response, simulating partial network failures at the protocol level. Use to answer: does the app handle malformed JSON, content-length lies, or truncated payloads without crashing?
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL of the page to test | |
| wait_ms | No | Milliseconds to wait after navigation before checking state (default: 2000) | |
| viewport | No | Viewport size (default: 1280×720) | |
| corruption_type | Yes | Type of corruption: malformed_json (unterminated JSON body), length_mismatch (content-length claims 99999 bytes but body is short), truncated (body cut off at truncate_at_byte) | |
| truncate_at_byte | No | Byte offset to truncate at (only used when corruption_type is truncated) | |
| fallback_selector | No | CSS selector for the fallback UI that should appear (e.g., '.parse-error') | |
| intercept_pattern | Yes | Glob pattern for requests to corrupt (e.g., '**/api/data**') |