-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Handle X-CSRF-TOKEN - CSRF #2272
Conversation
Order: 1. $_POST 2. HTTP HEADER 3. php://input - trying to parse posted JSON (last because of performance)
@nowackipawel you should add: public $CSRFHeaderName = 'X-CSRF-TOKEN'; to the |
I think that we should add a few tests to this (to cover handling CSRF by header and json) - but I like it. |
@nowackipawel it's fine. I can probably work on it later today - after work. |
Good idea to use built-in functions ;-) Co-Authored-By: Michal Sniatala <michal@sniatala.pl>
This is out of my knowledge but you two seem to know what you’re talking about. @michalsn is this ready to go? |
@MGatner Yes, it is. |
According to your comments, I have to agree: it could be useful and should be characterized by better performance than parsing php://input jsons everytime when $_POST token is not set.
@michalsn @jim-parry @lonnieezell
Order: