mega-mock
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -12,5 +12,6 @@ const path = require('path') | ||
const targetPath = path.resolve(options.dataFolder, 'temp_' + uploadId) | ||
const sizeNum = Number(size) | ||
const chunkSize = Number(req.headers['content-length']) | ||
if (!chunkSize) throw Error('content-length required') | ||
if (!chunkSize && sizeNum) throw Error('content-length required') | ||
@@ -52,3 +53,3 @@ if (!fs.existsSync(targetPath)) fs.writeFileSync(targetPath, Buffer.alloc(0)) | ||
const gotEnd = uploadState.length === 1 && uploadState[0][0] === 0 && uploadState[0][1] === Number(size) | ||
const gotEnd = uploadState.length === 1 && uploadState[0][0] === 0 && uploadState[0][1] === sizeNum | ||
if (gotEnd) { | ||
@@ -55,0 +56,0 @@ uploadStates.delete(uploadId) |
{ | ||
"name": "mega-mock", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "mega-mock mocks MEGA API servers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
21193
520