Skip to content

Commit

Permalink
Add Accept: application/json to Alchemy.xhr
Browse files Browse the repository at this point in the history
  • Loading branch information
mamhoff committed Mar 24, 2020
1 parent fbdd1a3 commit fb33836
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/alchemy/alchemy.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Alchemy.xhr = function(method, url) {
var token = document.querySelector('meta[name="csrf-token"]').attributes.content.textContent
xhr.open(method, url);
xhr.setRequestHeader('Content-type', 'application/json; charset=utf-8');
xhr.setRequestHeader('Accept', 'application/json');
xhr.setRequestHeader('X-CSRF-Token', token)

return xhr;
Expand Down

0 comments on commit fb33836

Please sign in to comment.