diff -rupN Django-1.3/docs/ref/contrib/csrf.txt Django-1.3-edited/docs/ref/contrib/csrf.txt
old
|
new
|
that allow headers to be set on every re
|
112 | 112 | } |
113 | 113 | return cookieValue; |
114 | 114 | } |
115 | | if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) { |
| 115 | var root = location.protocol + '//' + location.host; |
| 116 | if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url)) || settings.url.substr(0, root.length) === root ) { |
116 | 117 | // Only send the token to relative URLs i.e. locally. |
117 | 118 | xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); |
118 | 119 | } |