Commit d4daac52 authored by Tristan Cavelier's avatar Tristan Cavelier

overriding 'id' response key for get command -> fixed

parent f9702be7
...@@ -28,7 +28,11 @@ IODeferred.prototype.resolve = function (a, b) { ...@@ -28,7 +28,11 @@ IODeferred.prototype.resolve = function (a, b) {
} else { } else {
weak.status = constants.http_status.ok; weak.status = constants.http_status.ok;
weak.statusText = constants.http_status_text.ok; weak.statusText = constants.http_status_text.ok;
weak.id = this._info._id; if (this._method !== 'get') {
weak.id = this._info._id;
} else {
weak._id = this._info._id;
}
if (/Attachment$/.test(this._method)) { if (/Attachment$/.test(this._method)) {
weak.attachment = this._info._attachment; weak.attachment = this._info._attachment;
} }
...@@ -52,7 +56,7 @@ IODeferred.prototype.resolve = function (a, b) { ...@@ -52,7 +56,7 @@ IODeferred.prototype.resolve = function (a, b) {
} }
dictUpdate(weak, strong); dictUpdate(weak, strong);
strong = undefined; // free memory strong = undefined; // free memory
if (typeof weak.id !== 'string' || !weak.id) { if (this._method !== 'get' && (typeof weak.id !== 'string' || !weak.id)) {
return this.reject( return this.reject(
'internal_storage_error', 'internal_storage_error',
'invalid response', 'invalid response',
......
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