Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.3.X] Updated AJAX example code in CSRF docs to be consistent regar…

…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...
commit fda65ffea57bf6f15a94f37c4ab74352f679e282 1 parent af1943f
Luke Plant spookylukey authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  docs/ref/contrib/csrf.txt
2  docs/ref/contrib/csrf.txt
View
@@ -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)) {
Please sign in to comment.
Something went wrong with that request. Please try again.