From 0dd42fc32b508680cc685e10fd683c4addcc6ca5 Mon Sep 17 00:00:00 2001 From: Shane Tomlinson Date: Mon, 24 Sep 2012 14:40:09 +0100 Subject: [PATCH] Allow site-templates.js and templates.js to be requested on ephemeral instances but not on stage or prod. --- lib/static/views.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/static/views.js b/lib/static/views.js index 784c9d31c..a6d7e576e 100644 --- a/lib/static/views.js +++ b/lib/static/views.js @@ -235,15 +235,8 @@ exports.setup = function(app) { app.get('/i18n_fallback_test', function(req, res) { renderCachableView(req, res, path.join(testPath, 'i18n_fallback_test.ejs'), { layout: false, title: 'l10n testing title' }); }); - } else { - // this is stage or production, explicitly disable all resources under /test - app.get(/^\/test/, function(req, res) { - httputils.notFound(res, "Cannot " + req.method + " " + req.url); - }); - } - // /common/js/templates.js is dynamically built each time - if (!config.get('use_minified_resources')) { + // /common/js/templates.js is dynamically built each time var templates = require('../templates'); var dialogTemplatesPath = path.join(__dirname, '../../resources/static/dialog/views') app.get('/common/js/templates.js', function(req, res) { @@ -259,6 +252,12 @@ exports.setup = function(app) { siteTemplates += templates.generate(sitePartialTemplatesPath, "partial/"); res.send(siteTemplates); }); + + } else { + // this is stage or production, explicitly disable all resources under /test + app.get(/^\/test/, function(req, res) { + httputils.notFound(res, "Cannot " + req.method + " " + req.url); + }); } // REDIRECTS