Skip to content

Zepto plugin to set X-CSRFToken request header prior to making AJAX requests.

Notifications You must be signed in to change notification settings

dcompute/Zepto-CSRF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Zepto CSRF AJAX Plugin

This plugin extends Zepto.js' AJAX beforeSend method to set an X-CSRFToken header for any non-safe request methods.

This plugin is an adaptation of the jQuery CSRF ajaxSend functionality provided in the Django Cross Site Request Forgery protection documentation.

Usage

Simply include the script in your site's templates, after zepto.min.js:

<script type="text/javascript" src="zepto.csrf.min.js"></script>

That's it! If needed, any requests made through Zepto.AJAX will set an X-CSRFToken header.

About

Zepto plugin to set X-CSRFToken request header prior to making AJAX requests.

Resources

Stars

Watchers

Forks

Packages

No packages published