From 46c4acc68de9739add869c15f9c349f3018c266c Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Fri, 22 Feb 2013 19:56:26 +0100 Subject: [PATCH] Bug 842512 - Specify a character set for error pages; r=Waldo --- netwerk/test/httpserver/httpd.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/netwerk/test/httpserver/httpd.js b/netwerk/test/httpserver/httpd.js index 435f51d35259..5a40cc4fa584 100644 --- a/netwerk/test/httpserver/httpd.js +++ b/netwerk/test/httpserver/httpd.js @@ -2004,7 +2004,7 @@ function createHandlerFunc(handler) */ function defaultIndexHandler(metadata, response) { - response.setHeader("Content-Type", "text/html", false); + response.setHeader("Content-Type", "text/html;charset=utf-8", false); var path = htmlEscape(decodeURI(metadata.path)); @@ -3214,7 +3214,7 @@ ServerHandler.prototype = { // none of the data in metadata is reliable, so hard-code everything here response.setStatusLine("1.1", 400, "Bad Request"); - response.setHeader("Content-Type", "text/plain", false); + response.setHeader("Content-Type", "text/plain;charset=utf-8", false); var body = "Bad request\n"; response.bodyOutputStream.write(body, body.length); @@ -3222,7 +3222,7 @@ ServerHandler.prototype = 403: function(metadata, response) { response.setStatusLine(metadata.httpVersion, 403, "Forbidden"); - response.setHeader("Content-Type", "text/html", false); + response.setHeader("Content-Type", "text/html;charset=utf-8", false); var body = "\ 403 Forbidden\ @@ -3235,7 +3235,7 @@ ServerHandler.prototype = 404: function(metadata, response) { response.setStatusLine(metadata.httpVersion, 404, "Not Found"); - response.setHeader("Content-Type", "text/html", false); + response.setHeader("Content-Type", "text/html;charset=utf-8", false); var body = "\ 404 Not Found\ @@ -3255,7 +3255,7 @@ ServerHandler.prototype = response.setStatusLine(metadata.httpVersion, 416, "Requested Range Not Satisfiable"); - response.setHeader("Content-Type", "text/html", false); + response.setHeader("Content-Type", "text/html;charset=utf-8", false); var body = "\ \ @@ -3274,7 +3274,7 @@ ServerHandler.prototype = response.setStatusLine(metadata.httpVersion, 500, "Internal Server Error"); - response.setHeader("Content-Type", "text/html", false); + response.setHeader("Content-Type", "text/html;charset=utf-8", false); var body = "\ 500 Internal Server Error\ @@ -3289,7 +3289,7 @@ ServerHandler.prototype = 501: function(metadata, response) { response.setStatusLine(metadata.httpVersion, 501, "Not Implemented"); - response.setHeader("Content-Type", "text/html", false); + response.setHeader("Content-Type", "text/html;charset=utf-8", false); var body = "\ 501 Not Implemented\ @@ -3303,7 +3303,7 @@ ServerHandler.prototype = 505: function(metadata, response) { response.setStatusLine("1.1", 505, "HTTP Version Not Supported"); - response.setHeader("Content-Type", "text/html", false); + response.setHeader("Content-Type", "text/html;charset=utf-8", false); var body = "\ 505 HTTP Version Not Supported\ @@ -3325,7 +3325,7 @@ ServerHandler.prototype = "/": function(metadata, response) { response.setStatusLine(metadata.httpVersion, 200, "OK"); - response.setHeader("Content-Type", "text/html", false); + response.setHeader("Content-Type", "text/html;charset=utf-8", false); var body = "\ httpd.js\ @@ -3343,7 +3343,7 @@ ServerHandler.prototype = "/trace": function(metadata, response) { response.setStatusLine(metadata.httpVersion, 200, "OK"); - response.setHeader("Content-Type", "text/plain", false); + response.setHeader("Content-Type", "text/plain;charset=utf-8", false); var body = "Request-URI: " + metadata.scheme + "://" + metadata.host + ":" + metadata.port +