Upload: remove 'X-Requested-With' header

Fix test
pull/1644/head
qingwei.li 2016-12-09 10:08:35 +08:00 committed by 杨奕
parent 55dfb0c296
commit 2b247df9ca
2 changed files with 4 additions and 4 deletions

View File

@ -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) {

View File

@ -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();