mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02: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:
@@ -352,10 +352,31 @@ module.exports = HistoryController = {
|
||||
})
|
||||
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) {
|
||||
// client has disconnected -- skip delayed s3 download
|
||||
return
|
||||
}
|
||||
if (!body.zipUrl) {
|
||||
return next(
|
||||
new OError('Missing zipUrl, cannot fetch zip file', {
|
||||
v1ProjectId,
|
||||
body,
|
||||
statusCode: response.statusCode,
|
||||
})
|
||||
)
|
||||
}
|
||||
let retryAttempt = 0
|
||||
let retryDelay = 2000
|
||||
// retry for about 6 minutes starting with short delay
|
||||
|
||||
Reference in New Issue
Block a user