mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 14:03:42 -05: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:
parent
82af1be756
commit
9b8f11f517
1 changed files with 2 additions and 2 deletions
|
@ -77,8 +77,8 @@ module.exports =
|
||||||
if res.statusCode == 404
|
if res.statusCode == 404
|
||||||
logger.log bucketName:bucketName, key:key, "file not found in s3"
|
logger.log bucketName:bucketName, key:key, "file not found in s3"
|
||||||
return callback new Errors.NotFoundError("File not found in S3: #{bucketName}:#{key}"), null
|
return callback new Errors.NotFoundError("File not found in S3: #{bucketName}:#{key}"), null
|
||||||
if res.stausCode != 200
|
if res.statusCode not in [200, 206]
|
||||||
logger.log bucketName:bucketName, key:key, "error getting file from s3"
|
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
|
return callback new Error("Got non-200 response from S3: #{res.statusCode}"), null
|
||||||
callback null, res
|
callback null, res
|
||||||
s3Stream.on 'error', (err) ->
|
s3Stream.on 'error', (err) ->
|
||||||
|
|
Loading…
Reference in a new issue