Skip to content

Commit

Permalink
[1.3.X] Updated AJAX example code in CSRF docs to be consistent regar…
Browse files Browse the repository at this point in the history
…ding what are safe HTTP methods

Backport of [16202] from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@16203 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
spookylukey committed May 9, 2011
1 parent af1943f commit fda65ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/ref/contrib/csrf.txt
Expand Up @@ -125,7 +125,7 @@ that allow headers to be set on every request. In jQuery, you can use the
!(/^(\/\/|http:|https:).*/.test(url));
}
function safeMethod(method) {
return (method === 'GET' || method === 'HEAD');
return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
}

if (!safeMethod(settings.type) && sameOrigin(settings.url)) {
Expand Down

0 comments on commit fda65ff

Please sign in to comment.