Workaround imgur api only provide non-https image url which will cause mix-content warning in browsers

This commit is contained in:
Cheng-Han, Wu 2016-05-08 01:54:57 +08:00
parent 7aa21c8f19
commit 3b5e74c9c4

2
app.js
View file

@ -407,7 +407,7 @@ app.post('/uploadimage', function (req, res) {
if (config.debug) if (config.debug)
logger.info('SERVER uploadimage success: ' + JSON.stringify(json)); logger.info('SERVER uploadimage success: ' + JSON.stringify(json));
res.send({ res.send({
link: json.data.link link: json.data.link.replace(/^http:\/\//i, 'https://')
}); });
}) })
.catch(function (err) { .catch(function (err) {