-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add csrf filter middleware #89
Conversation
looks pretty good! I haven't done any browser related services for long time. do people use csrf tokens nowadays? |
Yes, that's definitely an option (and OWASP still recommends using both headers and some kind of tokens). Headers alone are sufficient, though, and supported in browsers for a long time. |
I think csrf middleware should support tokens otherwise it's functionality is similar to cors middleware. |
Should I perhaps try to merge this into the CORS middleware (and leave the token approach for future work)? That would probably involve something like adding |
hmm, I see. let's just merge it. |
Codecov Report
@@ Coverage Diff @@
## master #89 +/- ##
==========================================
- Coverage 78.76% 78.69% -0.07%
==========================================
Files 67 68 +1
Lines 8085 8139 +54
==========================================
+ Hits 6368 6405 +37
- Misses 1717 1734 +17
Continue to review full report at Codecov.
|
thanks! |
Cool, thanks. I guess it's different enough from the CORS middleware to warrant seperation. |
yes, especially if we add tokens later |
Hi. Many applications need a middleware that filters cross-site requests (to prevent CSRF). Here's an attempt to implement that.