birdpack 1.0.15 → 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.
Files changed (2) hide show
  1. package/lib/core.js +3 -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
- let match = (this.get('range') || '').slice(6).split('-');
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')
@@ -396,7 +397,6 @@ module.exports = class{
396
397
  }
397
398
 
398
399
  this.code(200)
399
- .length(data.length)
400
400
  .type(options.type);
401
401
 
402
402
  this.send(data);
package/package.json CHANGED
@@ -3,6 +3,6 @@
3
3
  "description": "BirdPack web framework is a tool for web server via TCP HTTP supporting websocket focusing on speed.",
4
4
  "author":"R938",
5
5
  "license":"R938",
6
- "version":"1.0.15",
6
+ "version":"1.0.17",
7
7
  "main": "index.js"
8
8
  }