birdpack 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core.js +3 -2
- package/package.json +1 -1
package/lib/core.js
CHANGED
|
@@ -338,7 +338,8 @@ module.exports = class{
|
|
|
338
338
|
|
|
339
339
|
if(fileRange == 'stream'){
|
|
340
340
|
const totalSize = fileStat.size;
|
|
341
|
-
|
|
341
|
+
const range = this.get('range') || '';
|
|
342
|
+
let match = range.slice(6).split('-');
|
|
342
343
|
|
|
343
344
|
const start = parseInt(match[0], 10) || 0;
|
|
344
345
|
const end = parseInt(match[1], 10) || totalSize - 1;
|
|
@@ -368,7 +369,7 @@ module.exports = class{
|
|
|
368
369
|
}
|
|
369
370
|
};
|
|
370
371
|
|
|
371
|
-
this.code(206)
|
|
372
|
+
this.code(range == '' ? 200 : 206)
|
|
372
373
|
.length(chunkSize)
|
|
373
374
|
.type(options.type)
|
|
374
375
|
.set('accept-ranges', 'bytes')
|