From 396bc58889005f9524edeef2ed9a13f49adc84a1 Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Mon, 9 May 2011 23:46:02 +0000 Subject: [PATCH] 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 --- docs/ref/contrib/csrf.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ref/contrib/csrf.txt b/docs/ref/contrib/csrf.txt index 9441393c81f..a3cf2ca9639 100644 --- a/docs/ref/contrib/csrf.txt +++ b/docs/ref/contrib/csrf.txt @@ -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)) {