Permalink
Browse files

Use 'X-CSRF-Token' in favor of deprecated 'X-Query-Params'

  • Loading branch information...
1 parent 4bcb614 commit 9189836b0e1cc8b5f88f45c803488ed1d92cf59c @jsteiner jsteiner committed Aug 6, 2012
Showing with 1 addition and 9 deletions.
  1. +1 −9 lib/assets/javascripts/jack_up/file_uploader.coffee
@@ -1,11 +1,3 @@
-railsCSRFData = ->
- csrfParam = $('meta[name=csrf-param]').attr('content')
- csrfToken = $('meta[name=csrf-token]').attr('content')
-
- formData = {}
- formData[csrfParam] = csrfToken
- JSON.stringify formData
-
class @JackUp.FileUploader
constructor: (@options) ->
@path = @options.path
@@ -49,7 +41,7 @@ class @JackUp.FileUploader
xhr.setRequestHeader 'Content-Type', file.type
xhr.setRequestHeader 'X-File-Name', file.name
- xhr.setRequestHeader 'X-Query-Params', railsCSRFData()
+ xhr.setRequestHeader 'X-CSRF-Token', $('meta[name=csrf-token]').attr('content')
@trigger 'upload:start', file: file
xhr.send file

0 comments on commit 9189836

Please sign in to comment.