Kaydet (Commit) 396bc588 authored tarafından Luke Plant's avatar Luke Plant

Updated AJAX example code in CSRF docs to be consistent regarding what are safe HTTP methods

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16202 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst cb060f0f
......@@ -117,7 +117,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)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment