From 82b71b2af7e7f942d793e5fba6dc3c8b6a394b5b Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Wed, 7 Jun 2017 16:55:11 -0700 Subject: [PATCH] hardcode prod to https urls --- server/portal_server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/portal_server.js b/server/portal_server.js index 31329320..3029f5d4 100644 --- a/server/portal_server.js +++ b/server/portal_server.js @@ -115,7 +115,8 @@ app.post('/upload/:id', (req, res, next) => { req.pipe(req.busboy); req.busboy.on('file', (fieldname, file, filename) => { console.log('Uploading: ' + filename); - let url = `${req.protocol}://${req.get('host')}/download/${req.params.id}/`; + const protocol = conf.env === 'development' ? req.protocol : 'https'; + let url = `${protocol}://${req.get('host')}/download/${req.params.id}/`; storage.set(req.params.id, file, filename, url).then(linkAndID => { res.json(linkAndID);