Skip to content
This repository was archived by the owner on Oct 3, 2020. It is now read-only.

Commit c8510e8

Browse files
committed
Fix: Adding Promise return for merge buffers function
1 parent 91e9c53 commit c8510e8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app.fetch.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
* method cannot have a body.
7272
* - redirect: The redirect mode to use: follow or error. If follow is set the result will
7373
* contain redairect information.
74-
* - requestId: Application innternall requests indetification system. It is set on each event
74+
* - requestId: Application innternall requests indetification system. It is set on each event
7575
* detail object
7676
*/
7777
constructor(url, opts) {
@@ -654,7 +654,7 @@
654654
return Promise.reject(new Error(`The response status is empty.
655655
It means that the successful connection wasn't made. Check your request parameters.`));
656656
}
657-
657+
658658
var promise;
659659
if (this._connection.body) {
660660
promise = this.decompressData(this._connection.body);
@@ -906,7 +906,8 @@
906906
}
907907
var buffer = this.stringToArrayBuffer(headers.join('\r\n'));
908908
var endBuffer = new Uint8Array([13, 10, 13, 10]).buffer;
909-
return this._concatArrayBuffers(buffer, endBuffer, fileBuffer);
909+
var result = this._concatArrayBuffers(buffer, endBuffer, fileBuffer);
910+
return Promise.resolve(result);
910911
}
911912
/**
912913
* Concatenates `ArrayBuffer`s into new Array buffer.
@@ -925,7 +926,7 @@
925926
});
926927
return tmp.buffer;
927928
}
928-
929+
929930
/**
930931
* Create an ArrayBuffer from the payload data.
931932
* In ARC the body can be only a String, File or FormData.

0 commit comments

Comments
 (0)