From 0fcb503fa45f6cb2d9a8782b5c867f0740957576 Mon Sep 17 00:00:00 2001 From: Andrew Wilcox Date: Sun, 20 Jan 2013 22:12:36 +0000 Subject: [PATCH 1/2] also exclude app.manifest from returning app_html --- app/server/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/server/server.js b/app/server/server.js index 76ab88f4ec..07da95d5be 100644 --- a/app/server/server.js +++ b/app/server/server.js @@ -123,8 +123,8 @@ var run = function () { app_html = runtime_config(app_html); app.use(function (req, res) { - // prevent favicon.ico and robots.txt from returning app_html - if (_.indexOf(['/favicon.ico', '/robots.txt'], req.url) !== -1) { + // prevent these URLs from returning app_html + if (_.indexOf(['/app.manifest', '/favicon.ico', '/robots.txt'], req.url) !== -1) { res.writeHead(404); res.end(); return; From 48010de100b81ab491c8e845dc5a48ebe7f65452 Mon Sep 17 00:00:00 2001 From: Nick Martin Date: Fri, 1 Feb 2013 11:20:22 -0800 Subject: [PATCH 2/2] Comment on app.manifest exclusion. --- app/server/server.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/server/server.js b/app/server/server.js index 07da95d5be..363725a166 100644 --- a/app/server/server.js +++ b/app/server/server.js @@ -124,7 +124,15 @@ var run = function () { app.use(function (req, res) { // prevent these URLs from returning app_html - if (_.indexOf(['/app.manifest', '/favicon.ico', '/robots.txt'], req.url) !== -1) { + // + // NOTE: app.manifest is not a web standard like favicon.ico and + // robots.txt. It is a file name we have chosen to use for HTML5 + // appcache URLs. It is included here to prevent using an appcache + // then removing it from poisoning an app permanently. Eventually, + // once we have server side routing, this won't be needed as + // unknown URLs with return a 404 automatically. + if (_.indexOf(['/app.manifest', '/favicon.ico', '/robots.txt'], req.url) + !== -1) { res.writeHead(404); res.end(); return;