mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
support url object with query-string when proxying to clsi
This commit is contained in:
parent
3c5eb9a730
commit
7f332c0436
1 changed files with 6 additions and 1 deletions
|
@ -114,6 +114,9 @@ module.exports = CompileController =
|
|||
if err?
|
||||
logger.err err:err, "error getting cookie jar for clsi request"
|
||||
return callback(err)
|
||||
# expand any url parameter passed in as {url:..., qs:...}
|
||||
if typeof url is "object"
|
||||
{url, qs} = url
|
||||
if limits.compileGroup == "priority"
|
||||
compilerUrl = Settings.apis.clsi_priority.url
|
||||
else
|
||||
|
@ -123,9 +126,11 @@ module.exports = CompileController =
|
|||
oneMinute = 60 * 1000
|
||||
# the base request
|
||||
options = { url: url, method: req.method, timeout: oneMinute, jar : jar }
|
||||
# add any provided query string
|
||||
options.qs = qs if qs?
|
||||
# if we have a build parameter, pass it through to the clsi
|
||||
if req.query?.pdfng && req.query?.build? # only for new pdf viewer
|
||||
options.qs = {}
|
||||
options.qs ?= {}
|
||||
options.qs.build = req.query.build
|
||||
# if we are byte serving pdfs, pass through If-* and Range headers
|
||||
# do not send any others, there's a proxying loop if Host: is passed!
|
||||
|
|
Loading…
Reference in a new issue