What a middleware function sees and can rewrite for a single attempt. headers is a real Headers instance (case-insensitive lookups/sets) and is fresh per attempt — mutating it does not affect other attempts or the caller's original RequestOptions.
headers
Headers
RequestOptions
Optional
0 = the first attempt, 1 = the first retry, etc.
The client's redirect mode, or undefined for fetch's default ("follow"). Middleware may read or override it per attempt.
redirect
"follow"
What a middleware function sees and can rewrite for a single attempt.
headersis a realHeadersinstance (case-insensitive lookups/sets) and is fresh per attempt — mutating it does not affect other attempts or the caller's originalRequestOptions.