mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-05 19:40:09 +00:00
fix: possible upload stream starting early
This commit is contained in:
parent
518b29c8df
commit
a646d6731a
@ -432,6 +432,8 @@ self.actuallyUpload = async (req, res, data = {}) => {
|
|||||||
|
|
||||||
if (hashStream) {
|
if (hashStream) {
|
||||||
hashStream.once('error', _reject)
|
hashStream.once('error', _reject)
|
||||||
|
// Ensure readStream will only be resumed later down the line by readStream.pipe()
|
||||||
|
readStream.pause()
|
||||||
readStream.on('data', data => {
|
readStream.on('data', data => {
|
||||||
// .dispose() will destroy this internal component,
|
// .dispose() will destroy this internal component,
|
||||||
// so use it as an indicator of whether the hashStream has been .dispose()'d
|
// so use it as an indicator of whether the hashStream has been .dispose()'d
|
||||||
|
Loading…
Reference in New Issue
Block a user