Commit 2b247df9 authored by qingwei.li's avatar qingwei.li Committed by 杨奕

Upload: remove 'X-Requested-With' header

Fix test
parent 55dfb0c2
......@@ -67,9 +67,9 @@ export default function upload(option) {
const headers = option.headers || {};
if (headers['X-Requested-With'] !== null) {
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
}
// if (headers['X-Requested-With'] !== null) {
// xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
// }
for (let item in headers) {
if (headers.hasOwnProperty(item) && headers[item] !== null) {
......
......@@ -34,7 +34,7 @@ describe('ajax', () => {
it('request width header', done => {
ajax(option);
expect(requests[0].requestHeaders).to.eql({
'X-Requested-With': 'XMLHttpRequest',
// 'X-Requested-With': 'XMLHttpRequest',
region: 'shanghai'
});
done();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment