From fc661ad3a211956b4d09cc1a32f5d3592878c796 Mon Sep 17 00:00:00 2001 From: "Quildreen \"Sorella\" Motta" Date: Sun, 28 Apr 2013 15:31:35 -0300 Subject: [PATCH] Specify the charset as UTF-8. Since Testling didn't specify the charset, this led to a plethora of random encoding errors if the libraries used anything outside of the ASCII charset. The same code would work or not on browsers with the same capabilities depending on whether the browser decided to treat the page as UTF-8 or not. Specifying the charset gets rid of all that and gives us predictable behaviours. Yay --- bin/cmd.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/cmd.js b/bin/cmd.js index f9fa7df..7a13c37 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -32,11 +32,14 @@ var server = http.createServer(function (req, res) { req.on('end', res.end.bind(res)); } else if (req.url === '/') { - res.setHeader('content-type', 'text/html'); - res.end(''); + res.setHeader('content-type', 'text/html; charset=utf-8'); + res.end('' + + '' + + '' + + ''); } else if (req.url === '/bundle.js') { - res.setHeader('content-type', 'application/javascript'); + res.setHeader('content-type', 'application/javascript; charset=utf-8'); res.end(prelude + '\n' + src); } });