mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Fix the check for a success response from S3.
We need to handle both a 200 and 206 (partial content) response.
This commit is contained in:
@@ -77,8 +77,8 @@ module.exports =
|
||||
if res.statusCode == 404
|
||||
logger.log bucketName:bucketName, key:key, "file not found in s3"
|
||||
return callback new Errors.NotFoundError("File not found in S3: #{bucketName}:#{key}"), null
|
||||
if res.stausCode != 200
|
||||
logger.log bucketName:bucketName, key:key, "error getting file from s3"
|
||||
if res.statusCode not in [200, 206]
|
||||
logger.log bucketName:bucketName, key:key, "error getting file from s3: #{res.statusCode}"
|
||||
return callback new Error("Got non-200 response from S3: #{res.statusCode}"), null
|
||||
callback null, res
|
||||
s3Stream.on 'error', (err) ->
|
||||
|
||||
Reference in New Issue
Block a user