Fix: Xhr response text #6

This commit is contained in:
surunzi
2016-05-25 14:48:08 +08:00
parent 9ffee878cf
commit 1f57e45922
2 changed files with 10 additions and 2 deletions

View File

@@ -39,14 +39,17 @@ export default class Request extends util.Emitter
}
handleDone()
{
var xhr = this._xhr;
var xhr = this._xhr,
resType = xhr.responseType;
var resTxt = (resType === '' || resType === 'text') ? xhr.responseText : '';
this.emit('update', this._id, {
status: xhr.status,
done: true,
size: getSize(xhr),
time: util.now(),
resTxt: xhr.responseText
resTxt: resTxt
});
}
};