-
Notifications
You must be signed in to change notification settings - Fork 82
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
feat!: invoke actions on POST only #149
base: master
Are you sure you want to change the base?
Conversation
I like the idea of restricting to POST only, in order to avoid XSS. |
I decided to use |
sorry for dragging my feet on this. I keep thinking I'll have time the next holiday to go over this, but real life keeps getting in the way. I like what I see so far; switching over to POST keeps things simple. |
@crccheck have you went over this PR? I'd really appreciate merging this in. Cheers! |
I think we need to phase in this feature more gradually. Like:
I've been meaning to do it for awhile but real life has gotten pretty busy |
Another try at enforcing POST actions. This change is more gradual than #149 - when library user doesn't change default options the behavior is exactly the same as before the change, that is: 1. Action buttons send GET requests 2. Action handlers accept GET and POST requests However, user can change this behavior using `methods` and `button_type` kwargs. For example `@action(methods=['POST'], button_type='form')` results in 1. Action button sends POST requests 2. Action handler accepts only POST request Unfortunately I have this tested only within my project. Also the docs are missing. And one more thing - I think it is better to use `<input type="submit">` instead of js to submit the form. This js is need to make the buttons look the same in both versions. With proper CSS (that is beyond my ability to write ;) ) js is avoidable and we could be using pretty semantic html submit button. I took the form button template from #149.
closes #16