mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Revert "revert to original CLSI proxy call"
This reverts commit 99b1b0d6598562b6346921504d1d1d37efe3be86.
This commit is contained in:
@@ -78,7 +78,12 @@ module.exports = CompileController =
|
||||
url = "#{compilerUrl}#{url}"
|
||||
logger.log url: url, "proxying to CLSI"
|
||||
oneMinute = 60 * 1000
|
||||
proxy = request(url: url, method: req.method, timeout: oneMinute)
|
||||
# pass through If-* and Range headers for byte serving pdfs
|
||||
# do not send any others, potential proxying loop if Host: is passed!
|
||||
newHeaders = {}
|
||||
for h, v of req.headers
|
||||
newHeaders[h] = req.headers[h] if h.match /^(If-|Range)/i
|
||||
proxy = request(url: url, method: req.method, timeout: oneMinute, headers: newHeaders)
|
||||
proxy.pipe(res)
|
||||
proxy.on "error", (error) ->
|
||||
logger.warn err: error, url: url, "CLSI proxy error"
|
||||
|
||||
Reference in New Issue
Block a user