Created
April 6, 2011 06:30
-
-
Save sdsykes/905227 to your computer and use it in GitHub Desktop.
Jumploader javascript to set csrf token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function appletInitialized(applet) { | |
setTimeout("set_applet_csrf()", 1000); | |
} | |
function set_applet_csrf() { | |
var name = "<%= request_forgery_protection_token %>"; | |
var value = "<%= form_authenticity_token %>"; | |
set_upload_param(name, value); | |
} | |
function set_upload_param(name, value) { | |
var uploader = document.jumpLoaderApplet.getUploader(); | |
var attrSet = uploader.getAttributeSet(); | |
var attr = attrSet.createStringAttribute(name, value); | |
attr.setSendToServer(true); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment