Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 390
- Log:
Initial import of Canvass, a donations-based poll application.
- Author:
- rool
- Date:
- Mon Mar 21 14:58:04 +0000 2011
- Size:
- 596 Bytes
1 | /* |
2 | * Registers a callback which copies the csrf token into the |
3 | * X-CSRF-Token header with each ajax request. Necessary to |
4 | * work with rails applications which have fixed |
5 | * CVE-2011-0447 |
6 | */ |
7 | |
8 | Ajax.Responders.register({ |
9 | onCreate: function(request) { |
10 | var csrf_meta_tag = $$('meta[name=csrf-token]')[0]; |
11 | |
12 | if (csrf_meta_tag) { |
13 | var header = 'X-CSRF-Token', |
14 | token = csrf_meta_tag.readAttribute('content'); |
15 | |
16 | if (!request.options.requestHeaders) { |
17 | request.options.requestHeaders = {}; |
18 | } |
19 | request.options.requestHeaders[header] = token; |
20 | } |
21 | } |
22 | }); |