diff --git a/lib/response.js b/lib/response.js index 38e01c1be..486a1f762 100644 --- a/lib/response.js +++ b/lib/response.js @@ -186,7 +186,7 @@ function showPublishNote(req, res, next) { filename: template }; var compiled = ejs.compile(fs.readFileSync(template, 'utf8'), options); - var origin = "//" + req.headers.host; + var origin = config.getserverurl(); var html = compiled({ title: title, viewcount: note.viewcount, @@ -246,7 +246,7 @@ function actionPretty(req, res, noteId) { title = Note.generateWebTitle(title); var template = config.prettypath; var compiled = ejs.compile(fs.readFileSync(template, 'utf8')); - var origin = "//" + req.headers.host; + var origin = config.getserverurl(); var html = compiled({ title: title, url: origin,