From 7f7cc459d076806d6281df23261d53dd8fe888b9 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Thu, 22 Sep 2011 19:54:46 +0100 Subject: [PATCH] Send MIME type along with HTML; Remove xml namespace declaration from HTML (not valid/needed in HTML5); Restrict command logging to /commands --- js/front.js | 3 ++- node/app.js | 2 ++ node/client/index.html.jade | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/front.js b/js/front.js index 0dae4a5..93d296c 100644 --- a/js/front.js +++ b/js/front.js @@ -274,8 +274,9 @@ kiwi.front = { // Update msg if it's been changed by any plugins msg = plugin_event.command.toString(); - console.log("running " + msg); + if (msg.substring(0, 1) === '/') { + console.log("running " + msg); parts = msg.split(' '); switch (parts[0].toLowerCase()) { case '/j': diff --git a/node/app.js b/node/app.js index ed1b70d..458c2df 100644 --- a/node/app.js +++ b/node/app.js @@ -600,6 +600,7 @@ this.httpHandler = function (request, response) { response.statusCode = 304; } else { response.setHeader('Etag', kiwi.cache.html[hash].hash); + response.setHeader('Content-type', 'text/html'); response.write(kiwi.cache.html[hash].html); } response.end(); @@ -614,6 +615,7 @@ this.httpHandler = function (request, response) { response.statusCode = 304; } else { response.setHeader('Etag', hash2); + response.setHeader('Content-type', 'text/html'); response.write(html); } } else { diff --git a/node/client/index.html.jade b/node/client/index.html.jade index 38ccf15..2828368 100644 --- a/node/client/index.html.jade +++ b/node/client/index.html.jade @@ -1,5 +1,5 @@ !!! 5 -html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb") +html(lang="en-gb") head meta(http-equiv="Content-Type", content="text/html; charset=utf-8") -- 2.25.1