mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-04 04:15:58 +00:00
Rename request -> s3Request to prevent overwriting main import
This commit is contained in:
parent
a1d4685dd8
commit
86b9e4b53a
1 changed files with 4 additions and 4 deletions
|
@ -95,9 +95,9 @@ module.exports =
|
|||
}
|
||||
if opts.start? and opts.end?
|
||||
s3Params['Range'] = "bytes=#{opts.start}-#{opts.end}"
|
||||
request = s3.getObject(s3Params)
|
||||
s3Request = s3.getObject(s3Params)
|
||||
|
||||
request.on 'httpHeaders', (statusCode, headers, response, statusMessage) =>
|
||||
s3Request.on 'httpHeaders', (statusCode, headers, response, statusMessage) =>
|
||||
if statusCode in [403, 404]
|
||||
# S3 returns a 403 instead of a 404 when the user doesn't have
|
||||
# permission to list the bucket contents.
|
||||
|
@ -109,11 +109,11 @@ module.exports =
|
|||
stream = response.httpResponse.createUnbufferedStream()
|
||||
callback(null, stream)
|
||||
|
||||
request.on 'error', (err) =>
|
||||
s3Request.on 'error', (err) =>
|
||||
logger.err({ err: err, bucketName: bucketName, key: key }, "error getting file stream from s3")
|
||||
callback(err)
|
||||
|
||||
request.send()
|
||||
s3Request.send()
|
||||
|
||||
getFileSize: (bucketName, key, callback) ->
|
||||
logger.log({ bucketName: bucketName, key: key }, "getting file size from S3")
|
||||
|
|
Loading…
Reference in a new issue