mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
enable range requests on files via ?range=m-n
query string.
This commit is contained in:
parent
af78e893f9
commit
4f533147b1
1 changed files with 5 additions and 0 deletions
|
@ -42,6 +42,11 @@ module.exports = FileStoreHandler =
|
|||
method : "get"
|
||||
uri: "#{@_buildUrl(project_id, file_id)}#{queryString}"
|
||||
timeout:fiveMinsInMs
|
||||
headers: {}
|
||||
if query? and query['range']?
|
||||
rangeText = query['range']
|
||||
if rangeText && rangeText.match? && rangeText.match(/\d+-\d+/)
|
||||
opts.headers['range'] = "bytes=#{query['range']}"
|
||||
readStream = request(opts)
|
||||
readStream.on "error", (err) ->
|
||||
logger.err {err, project_id, file_id, query}, "error in file stream"
|
||||
|
|
Loading…
Reference in a new issue