Conversation
…ving to provide a http.Request
|
Requesting review from @gorilla/pull-request-reviewers. :) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #176 +/- ##
==========================================
+ Coverage 90.93% 91.03% +0.10%
==========================================
Files 5 5
Lines 353 357 +4
==========================================
+ Hits 321 325 +4
Misses 25 25
Partials 7 7 ☔ View full report in Codecov by Sentry. |
|
@jaitaiwan this looks good to me - mind giving it a quick second look and merging if you're happy with it as well? In summary, it makes it so a token can be fetched directly from a context instead of having to wrap it in an |
|
Hi there, |
|
I’m on mobile right now but I can’t see an easy way to re run. Will sort it on desktop soon. |
|
Any update on this? ;) |
What type of PR is this? (check all applicable)
Description
In order for
csrfto play nicely with libraries like huma is seems beneficial to be able to retrieve a token not just from ahttp.Requestbut also straight from thecontext.Context.This avoids workarounds like creating a dummy request just to pass along the context.
Additionally, it feels more natural to me to pass the actually required value (with is a
context.Context) instead of the value wrapped with something else that is not really required for retrieving the token.Related Tickets & Documents
n. a.
Added/updated tests?
Run verifications and test
make verifyis passingmake testis passing