From 0b5b8136066f50521ad66cb34d81164882042b4f Mon Sep 17 00:00:00 2001 From: WubTheCaptain Date: Mon, 21 Sep 2015 05:26:20 +0000 Subject: Clean up HTML response construct, uppercase UTF-8 IANA has registered UTF-8 as uppercase, hyphenated. The RFC concerning UTF-8, RFC 3629 also uses this grammar. RFC 2231 says the Content-Type charset value should be: charset := RFC 5987 further emphasizes this: charset = "UTF-8" / "ISO-8859-1" / mime-charset Therefore lowercase "utf-8" in Content-Type responses is technically incorrect, but case-insensitive according to RFC 2616. Thanks to pantsucat for researching this with me. --- static/classes/Response.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'static') diff --git a/static/classes/Response.class.php b/static/classes/Response.class.php index b7e4c5d..037d94f 100755 --- a/static/classes/Response.class.php +++ b/static/classes/Response.class.php @@ -16,10 +16,9 @@ class Response header('Content-Type: text/plain; charset=UTF-8'); $this->type = $response_type; break; - case 'html': - header('Content-Type: text/html;charset=utf-8'); - $this->type = 'html'; + header('Content-Type: text/html; charset=UTF-8'); + $this->type = $response_type; break; default: header('Content-Type: application/json; charset=UTF-8'); @@ -107,6 +106,7 @@ class Response { return POMF_URL.$files[0]['url']; } + private static function txt_error($code, $description) { return 'ERROR: ('.$code.') '.$description; -- cgit v1.2.3