You misunderstood.
In the current implementation all requests with X-Requested-With header
are checked for CSRF token, whether or not it's really needed. It's
better to only check requests from pages which used
jquery_ajax_csrf_protection helper for rendering. Session can be used
to store when the helper is called, somehow.
Чтв Дек 22 13:00:27 2011, KOORCHIK писал:
Show quoted text> Срд Дек 21 03:50:42 2011, nikita.dedik@bulyon.com писал:
> > Protection should be enabled only for AJAX requests which used
> > jquery_ajax_csrf_protection helper.
> You should use this helper in your template. It will add javascript
> which registers callback which adds protection when "ajaxSend" event
> occurs. So, "jquery_ajax_csrf_protection" helper is called only by
> action which renders html page.
>
> >Currently the protection is enabled
> > for all AJAX requests, even when it's not needed. Example: infinite
> > scrolling (which is an AJAX but doesn't require protection).
> I cannot distinguish between events which require protection and
events
Show quoted text> which do not require protection. If you use JQuery for sending ajax
then
Show quoted text> everything will be ok. For example, "infinite scrolling" in jqGrid
works
Show quoted text> just fine.
>
> jquery_ajax_csrf_protection