mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
use url.resolve to adding https:// part
This commit is contained in:
parent
a2a8b7123b
commit
0cbd9d0ff9
1 changed files with 7 additions and 4 deletions
|
@ -7,12 +7,12 @@ querystring = require('querystring')
|
||||||
SystemMessageManager = require("../Features/SystemMessages/SystemMessageManager")
|
SystemMessageManager = require("../Features/SystemMessages/SystemMessageManager")
|
||||||
_ = require("underscore")
|
_ = require("underscore")
|
||||||
Modules = require "./Modules"
|
Modules = require "./Modules"
|
||||||
|
url = require "url"
|
||||||
|
|
||||||
fingerprints = {}
|
fingerprints = {}
|
||||||
Path = require 'path'
|
Path = require 'path'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
jsPath =
|
jsPath =
|
||||||
if Settings.useMinifiedJs
|
if Settings.useMinifiedJs
|
||||||
"/minjs/"
|
"/minjs/"
|
||||||
|
@ -71,14 +71,17 @@ module.exports = (app, webRouter, apiRouter)->
|
||||||
res.locals.buildJsPath = (jsFile, fingerprint)->
|
res.locals.buildJsPath = (jsFile, fingerprint)->
|
||||||
if !fingerprint?
|
if !fingerprint?
|
||||||
fingerprint = getFingerprint(jsPath + jsFile)
|
fingerprint = getFingerprint(jsPath + jsFile)
|
||||||
p = Path.join(staticFilesBase, jsPath, jsFile) + "?fingerprint=" + fingerprint
|
p = Path.join(jsPath, jsFile)
|
||||||
|
return url.resolve(staticFilesBase, p) + "?fingerprint=" + fingerprint
|
||||||
|
|
||||||
|
|
||||||
res.locals.buildCssPath = (cssFile)->
|
res.locals.buildCssPath = (cssFile)->
|
||||||
return Path.join(staticFilesBase, cssPath, cssFile) + "?fingerprint=" + getFingerprint(cssPath + cssFile)
|
p = Path.join(cssPath, cssFile)
|
||||||
|
return url.resolve(staticFilesBase, p) + "?fingerprint=" + getFingerprint(cssPath + cssFile)
|
||||||
|
|
||||||
res.locals.buildImgPath = (imgFile)->
|
res.locals.buildImgPath = (imgFile)->
|
||||||
return Path.join(staticFilesBase, imgPath, imgFile)
|
p = Path.join(imgPath, imgFile)
|
||||||
|
return url.resolve(staticFilesBase, p)
|
||||||
|
|
||||||
next()
|
next()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue