Changeset 2462 for trunk/framework/Web

Show
Ignore:
Timestamp:
05/16/2008 07:59:42 AM (8 months ago)
Author:
tof
Message:

Fixed #841

Location:
trunk/framework/Web
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/framework/Web/THttpRequest.php

    r2364 r2462  
    346346 
    347347        /** 
     348         * @return string the requested http procolol. Blank string if not defined. 
     349         */ 
     350        public function getHttpProtocolVersion () 
     351        { 
     352                return isset($_SERVER['SERVER_PROTOCOL'])?$_SERVER['SERVER_PROTOCOL']:''; 
     353        } 
     354         
     355        /** 
    348356         * @return string part of that request URL after the host info (including pathinfo and query string) 
    349357         */ 
  • trunk/framework/Web/THttpResponse.php

    r2445 r2462  
    258258        /** 
    259259         * Set the HTTP status code for the response. 
     260         * The code and its reason will be sent to client using the currently requested http protocol version (see {@link THttpRequest::getHttpProtocolVersion}) 
     261         * Keep in mind that HTTP/1.0 clients might not understand all status codes from HTTP/1.1 
    260262         *  
    261263         * @param integer HTTP status code 
     264         * @param string HTTP status reason, defaults to standard HTTP reasons 
    262265         */ 
    263266        public function setStatusCode($status, $reason=null) 
     
    433436        protected function sendHttpHeader () 
    434437        { 
    435                 header("HTTP/1.1 {$this->_status} {$this->_reason}", true, $this->_status); 
     438                if (($version=$this->getRequest()->getHttpProtocolVersion())==='') 
     439                        header (' ', true, $this->_status); 
     440                else 
     441                        header($version.' '.$this->_status.' '.$this->_reason, true, $this->_status); 
    436442        } 
    437443