修复文件上传时末尾\r\n时无法读取的错误

This commit is contained in:
2023-03-10 18:19:17 +08:00
parent a6b65e75b8
commit ce82e24e2c
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "yizhi-multipart-reader",
"version": "1.0.6",
"version": "1.0.7",
"description": "",
"main": "dist/index.js",
"types": "typing/index.d.ts",
@ -14,4 +14,4 @@
"@types/node": "^17.0.23",
"typescript": "^4.6.3"
}
}
}

View File

@ -256,6 +256,8 @@ export class MultipartReader {
return { left: data.slice(i), exit: false }
}
}
//如果后面不是--则回退一个字节如果不回退下次循环时i的位置就变成后一个位置了某些情况下将导致出错
else --i
}
}
}