fix(cookie): remove unreachable SameSiteDefaultMode case - #4471
Conversation
The first switch never assigns http.SameSiteDefaultMode to sameSite, so the corresponding case in the fasthttp mapping was dead code. The "disabled" value (0) already falls through to default -> CookieSameSiteDisabled. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
WalkthroughIn ChangesSameSite Cookie Handling
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4471 +/- ##
==========================================
+ Coverage 92.91% 92.92% +0.01%
==========================================
Files 138 138
Lines 13570 13568 -2
==========================================
Hits 12608 12608
+ Misses 595 593 -2
Partials 367 367
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
A static analysis run flagged
res.go:326as a dead condition. Verified and confirmed.In
setCookie/Cookie, the first switch maps the FiberSameSitestring onto anhttp.SameSitevalue. It only ever produces0(disabled),SameSiteLaxMode,SameSiteStrictMode, orSameSiteNoneMode.http.SameSiteDefaultMode(= 1) is never assigned, and nothing mutatessameSitebetween the two switches.So the
case http.SameSiteDefaultModein the fasthttp mapping switch was unreachable. The0(disabled) value already falls through todefault->fasthttp.CookieSameSiteDisabled, so behavior is unchanged.Changes
case http.SameSiteDefaultModebranch.No behavior change; build passes.
🤖 Generated with Claude Code