Skip to content

Comment on Django Security Releases Issued

Comments

A bothersome change, especially for all those employing jQuery plugins that don't have a quick method to add the CSRF token to AJAX requests.

I think I might just add @csrf_exempt, as long as we aren't changing vital info via the request...

Out of curiosity, why doesn't hooking beforeSend (as suggested in the blog post) work?

I haven't had a chance to try it, but if it gracefully handles every jQuery plug-ins' use of the .ajax() method, I don't see why it wouldn't work.

This is correct. So long as the plugins themselves are using jQuery's own $.ajax() method (or one of its derivatives that in turn call it), then anything in ajaxSetup will be reflected in those requests.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.