Skip to content

fetch: only reject WHATWG redirect statuses under redirect: 'error' - #36539

Merged
Jarred-Sumner merged 8 commits into
mainfrom
farm/9fa33ec8/fetch-redirect-error-3xx
Jul 31, 2026
Merged

Jarred-Sumner merged 8 commits into
mainfrom
farm/9fa33ec8/fetch-redirect-error-3xx

fetch: only reject WHATWG redirect statuses under redirect: 'error'

c2df7cf
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 31, 2026 in 8m 50s

Code review found 1 potential issue

Found 3 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/http/lib.rs:5042 Inner status_code match arm made dead by narrowed is_redirect

Annotations

Check warning on line 5042 in src/http/lib.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Inner status_code match arm made dead by narrowed is_redirect

Now that `is_redirect` is exactly `{301, 302, 303, 307, 308}`, the inner `match status_code { 302 | 301 | 307 | 308 | 303 => { ... } _ => {} }` at line 5049 is a redundant guard — its `_ => {}` arm is unreachable. Per REVIEW.md ('Delete dead code in the same PR that makes it dead … guards a new validator makes redundant'), the match wrapper can be collapsed and its body kept directly under the Follow-mode `if`.