mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-18 19:32:34 -05:00
af2d959504
Implement v1 open-with-overleaf API in v2 (part 1) GitOrigin-RevId: 488f4eeefc29086a72295ccbc7c63d2f927add12
14 lines
No EOL
433 B
CoffeeScript
14 lines
No EOL
433 B
CoffeeScript
Settings = require 'settings-sharelatex'
|
|
|
|
module.exports = UrlHelper =
|
|
|
|
wrapUrlWithProxy: (url) ->
|
|
# TODO: Consider what to do for Community and Enterprise edition?
|
|
if !Settings.apis?.linkedUrlProxy?.url?
|
|
throw new Error('no linked url proxy configured')
|
|
return "#{Settings.apis.linkedUrlProxy.url}?url=#{encodeURIComponent(url)}"
|
|
|
|
prependHttpIfNeeded: (url) ->
|
|
if !url.match('://')
|
|
url = 'http://' + url
|
|
return url |