From 278a5eb294b2df859c7eb20c6e35e32280a8b613 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sat, 15 Jan 2011 12:18:09 +0100 Subject: Remove superfluous headers, fix XML-RPC with gzip enabled This removes headers that are sent by PHP/the webserver anyway as they are possibly wrong as e.g. when gzip compression is enabled in inc/init.php (which does happen when the client supports gzip) the content size is smaller than the one that was specified by the content-length header and thus e.g. the Python XML-RPC client fails with an error message because of the size mismatch. Additionally the content encoding is now set to utf-8 in the http headers. --- inc/IXR_Library.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'inc/IXR_Library.php') diff --git a/inc/IXR_Library.php b/inc/IXR_Library.php index c7f83a6d6..c8255e6d9 100644 --- a/inc/IXR_Library.php +++ b/inc/IXR_Library.php @@ -395,13 +395,8 @@ EOD; $this->output($error->getXml()); } function output($xml) { - $xml = ''."\n".$xml; - $length = strlen($xml); - header('Connection: close'); - header('Content-Length: '.$length); - header('Content-Type: text/xml'); - header('Date: '.date('r')); - echo $xml; + header('Content-Type: text/xml; charset=utf-8'); + echo '', "\n", $xml; exit; } function hasMethod($method) { -- cgit v1.2.3