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

Commit d342274

Browse files
haobibolbustelo
authored andcommitted
Fix urth-core-import package issue (#549)
Replacement for #542 and #542 This PR fix issue mentioned in #538 by adding a XSRF filed in post request header.
1 parent 0576c02 commit d342274

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

elements/urth-core-import/urth-core-import.html

+9
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,15 @@
171171
errorCB.call(this, msg);
172172
}.bind(this));
173173
}
174+
175+
var r = document.cookie.match("\\b" + name + "=([^;]*)\\b");
176+
r = r ? r[1] : undefined;
177+
if(r){
178+
if (!this.$.ajaxPost.headers) {
179+
this.$.ajaxPost.headers = {};
180+
}
181+
this.$.ajaxPost.headers['X-XSRFToken'] = r;
182+
}
174183

175184
this.$.ajaxPost.generateRequest();
176185
},

0 commit comments

Comments
 (0)