mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #4892 from overleaf/jk-token-zip-download-fix
Fix download-zip-from-v1 for users without overleaf ids GitOrigin-RevId: cf70a010041e143b573d534eb956e4b48b108436
This commit is contained in:
parent
e8b37b2e7d
commit
cae921b30a
1 changed files with 21 additions and 0 deletions
|
@ -352,10 +352,31 @@ module.exports = HistoryController = {
|
||||||
})
|
})
|
||||||
return next(err)
|
return next(err)
|
||||||
}
|
}
|
||||||
|
if (response.statusCode !== 200) {
|
||||||
|
if (response.statusCode === 404) {
|
||||||
|
return next(new Errors.NotFoundError('zip not found'))
|
||||||
|
} else {
|
||||||
|
return next(
|
||||||
|
new OError('Error while getting zip for download', {
|
||||||
|
v1ProjectId,
|
||||||
|
statusCode: response.statusCode,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
if (req.aborted) {
|
if (req.aborted) {
|
||||||
// client has disconnected -- skip delayed s3 download
|
// client has disconnected -- skip delayed s3 download
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!body.zipUrl) {
|
||||||
|
return next(
|
||||||
|
new OError('Missing zipUrl, cannot fetch zip file', {
|
||||||
|
v1ProjectId,
|
||||||
|
body,
|
||||||
|
statusCode: response.statusCode,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
let retryAttempt = 0
|
let retryAttempt = 0
|
||||||
let retryDelay = 2000
|
let retryDelay = 2000
|
||||||
// retry for about 6 minutes starting with short delay
|
// retry for about 6 minutes starting with short delay
|
||||||
|
|
Loading…
Reference in a new issue