From f313138c9545d567d411e80aead77eb03c83ae25 Mon Sep 17 00:00:00 2001 From: tof <> Date: Fri, 16 May 2008 12:59:42 +0000 Subject: Fixed #841 --- framework/Web/THttpResponse.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'framework/Web/THttpResponse.php') diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index af751828..64c9eaba 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -257,8 +257,11 @@ class THttpResponse extends TModule implements ITextWriter /** * Set the HTTP status code for the response. + * The code and its reason will be sent to client using the currently requested http protocol version (see {@link THttpRequest::getHttpProtocolVersion}) + * Keep in mind that HTTP/1.0 clients might not understand all status codes from HTTP/1.1 * * @param integer HTTP status code + * @param string HTTP status reason, defaults to standard HTTP reasons */ public function setStatusCode($status, $reason=null) { @@ -432,7 +435,10 @@ class THttpResponse extends TModule implements ITextWriter */ protected function sendHttpHeader () { - header("HTTP/1.1 {$this->_status} {$this->_reason}", true, $this->_status); + if (($version=$this->getRequest()->getHttpProtocolVersion())==='') + header (' ', true, $this->_status); + else + header($version.' '.$this->_status.' '.$this->_reason, true, $this->_status); } /** -- cgit v1.2.3