Re:JSON users: Avoid CSRFs by not using top-level arrays
by mmmm on Saturday June 18, 2011 @05:07PM
(#2669551)
Thanks a lot for the excellent explanation. I tend to do my Ajax requests with post just to get the token in. Is there a reason not doing so, like savings in bandwidth or something like that? Might that be a gain Facebook is trying to achieve?
[ Parent
| on HN ]
Re:JSON users: Avoid CSRFs by not using top-level arrays
by rimantas on Sunday June 19, 2011 @05:27AM
(#2670626)
> Is there a reason not doing so, like savings in bandwidth or something
> like that?
GETs may perform slightly better, see http://developer.yahoo.com/performance/rules.html#ajax_get
Re:JSON users: Avoid CSRFs by not using top-level arrays
by squeed on Saturday June 18, 2011 @06:27PM
(#2669693)
Yours is a good solution, and effectively blocks the attack mentioned in this article. From a REST purity standpoint, it's "unclean" to require all API calls to be POSTS, but, hey, life is short.