Changeset 2462 for trunk/framework/Web
- Timestamp:
- 05/16/2008 07:59:42 AM (8 months ago)
- Location:
- trunk/framework/Web
- Files:
-
- 2 modified
-
THttpRequest.php (modified) (1 diff)
-
THttpResponse.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/framework/Web/THttpRequest.php
r2364 r2462 346 346 347 347 /** 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 /** 348 356 * @return string part of that request URL after the host info (including pathinfo and query string) 349 357 */ -
trunk/framework/Web/THttpResponse.php
r2445 r2462 258 258 /** 259 259 * 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 260 262 * 261 263 * @param integer HTTP status code 264 * @param string HTTP status reason, defaults to standard HTTP reasons 262 265 */ 263 266 public function setStatusCode($status, $reason=null) … … 433 436 protected function sendHttpHeader () 434 437 { 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); 436 442 } 437 443
