Skip to main content

redirect_policy

Function redirect_policy 

pub fn redirect_policy() -> Policy
Expand description

Redirect policy for clients whose requests may carry the session header.

On a redirect to a different host, reqwest strips only credential headers (Authorization, cookies, and proxy credentials), so under its default policy a 3xx from an OpenCode host would carry x-opencode-session wherever it points. This policy follows same-host redirects up to reqwest’s default limit and stops at the first hop to another host or port, handing that 3xx back to the caller instead.