Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Fix urth-core-import package issue (#549)
Browse files Browse the repository at this point in the history
Replacement for #542 and #542

This PR fix issue mentioned in #538 by adding a XSRF filed in post
request header.
  • Loading branch information
haobibo authored and lbustelo committed Mar 27, 2017
1 parent 0576c02 commit d342274
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions elements/urth-core-import/urth-core-import.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@
errorCB.call(this, msg);
}.bind(this));
}

var r = document.cookie.match("\\b" + name + "=([^;]*)\\b");
r = r ? r[1] : undefined;
if(r){
if (!this.$.ajaxPost.headers) {
this.$.ajaxPost.headers = {};
}
this.$.ajaxPost.headers['X-XSRFToken'] = r;
}

this.$.ajaxPost.generateRequest();
},
Expand Down

0 comments on commit d342274

Please sign in to comment.