Skip to content

Commit 68ceab6

Browse files
authored
convert startByte to integer
Condition "!startByte" has never been truthy, because "0" isn't empty string
1 parent 90b4237 commit 68ceab6

File tree

1 file changed

+1
-1
lines changed
  • 5-network/09-resume-upload/upload-resume.view

1 file changed

+1
-1
lines changed

5-network/09-resume-upload/upload-resume.view/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let uploads = Object.create(null);
1010
function onUpload(req, res) {
1111

1212
let fileId = req.headers['x-file-id'];
13-
let startByte = req.headers['x-start-byte'];
13+
let startByte = parseInt(req.headers['x-start-byte']);
1414

1515
if (!fileId) {
1616
res.writeHead(400, "No file id");

0 commit comments

Comments
 (0)