Fixes #1268 - fix issue with default protocol of https for local development

This commit is contained in:
Cassie Tarakajian 2020-04-10 18:30:07 -04:00
parent e9ddf6a8ea
commit ce1628cd69
2 changed files with 3 additions and 2 deletions

View File

@ -25,7 +25,7 @@ export function serveProject(req, res) {
const sketchDoc = window.document;
const base = sketchDoc.createElement('base');
const fullUrl = `https://${req.get('host')}${req.originalUrl}`;
const fullUrl = `${req.protocol}://${req.get('host')}${req.originalUrl}`;
base.href = `${fullUrl}/`;
sketchDoc.head.appendChild(base);

View File

@ -7,9 +7,10 @@ const router = new Router();
router.get('/:username/sketches/:project_id/*', getProjectAsset);
router.get('/full/:project_id/*', getProjectAsset);
router.get('/:username/full/:project_id/*', getProjectAsset);
router.get('/present/:project_id/*', getProjectAsset);
router.get('/:username/present/:project_id/*', getProjectAsset);
router.get('/embed/:project_id/*', getProjectAsset);
router.get('/:username/embed/:project_id/*', getProjectAsset);
router.get('/:username/present/:project_id/*', getProjectAsset);
router.get('/sketches/:project_id/assets/*?', getFileContent);