Does Puppeteer Follow Redirects Automatically When Request Interception Is Enabled?
0 reputation · 02 Aug 2022, 20:17 UTC
When request interception is enabled in Puppeteer via page.setRequestInterception(true), each outgoing request is paused and must be resolved with request.continue(), request.abort(), or request.override(). The goal is to determine whether Puppeteer automatically follows HTTP redirects (e.g., 301/302 responses) under interception, or if developers must manually inspect the Location header and issue a new request to emulate redirect behavior. This uncertainty affects test reliability when mocking APIs or simulating network conditions.
Does Puppeteer follow redirects automatically when interception is active? Should developers manually read the Location header and issue a new request to reproduce the redirect? Is there a way to enable automatic redirect handling while keeping interception enabled?