Safely split incoming request headers, remove support for token presence in request body#39427
Conversation
zwass
left a comment
There was a problem hiding this comment.
How about an approach where we use strings.CutPrefix(headers, "BEARER ") and then checking the bool value and using the cut string if the prefix was found?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #39427 +/- ##
========================================
Coverage 66.27% 66.28%
========================================
Files 2439 2440 +1
Lines 195401 195554 +153
Branches 8615 8615
========================================
+ Hits 129511 129619 +108
- Misses 54160 54200 +40
- Partials 11730 11735 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e980893 to
9fc54f4
Compare
|
@zwass ah, that'd be nice and clean if we're okay only supporting the all-caps version? I also based |
9fc54f4 to
e0040fd
Compare
|
@zwass it seems like "Bearer" should be treated case-insensitively while the token value should be case-sensitive. Are you okay with the current approach? |
|
@jacobshandling Split of form parsing removal and dead code removal makes sense. The form field removal bits seem fine, though since they're only basically two LOC I'll defer to Zach for full PR approval. |
43f3b2f to
f38f71d
Compare
Code Review SummaryStatus: 5 Suggestions Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
NotesWell, I think this is a really thoughtful change, neighbor. Replacing The removal of the Thank you for taking the time to make this improvement. Files Reviewed (2 files)
|
Related issues:
See https://fleetdm.slack.com/archives/C019WG4GH0A/p1770322925865209