Skip to content

Commit

Permalink
fix authenticate token upload file
Browse files Browse the repository at this point in the history
  • Loading branch information
hailt-rikkei committed Dec 4, 2019
1 parent 8bb5b55 commit 46165a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions vendor/assets/javascripts/redactor-rails/redactor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9136,7 +9136,9 @@ REDACTOR = {version: "10.2.5", instances: {}, params: {}};
}

var xhr = new XMLHttpRequest();
var csrf_token = $('meta[name=csrf-token]').attr('content');
xhr.open('POST', this.upload.url);
xhr.setRequestHeader('X-CSRF-Token', csrf_token);
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");

// complete
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/redactor-rails/redactor.min.js

Large diffs are not rendered by default.

0 comments on commit 46165a3

Please sign in to comment.