Changeset 1146 for trunk/lib/clearbricks

Show
Ignore:
Timestamp:
11/04/08 11:13:45 (2 months ago)
Author:
laurentj
Message:

ticket #714: updated clearbricks with its latest trunk version to fix a bug on net.http

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/clearbricks/net.http/class.net.http.php

    r767 r1146  
    6868        protected $accept_language = 'en-us';   ///<    <b>string</b>           HTTP accept language 
    6969        protected $user_agent = 'Clearbricks HTTP Client';      ///< <b>string</b>      HTTP User Agent 
     70        protected $more_headers = array();              ///< <b>array</b>               More headers to be sent 
    7071        protected $timeout = 10;                                ///<    <b>integer</b>          Connection timeout 
    7172        protected $use_ssl = false;                     ///<    <b>boolean</b>          Use SSL connection 
     
    382383                } 
    383384                 
     385                # X-Forwarded-For 
     386                $xforward= array($_SERVER['REMOTE_ADDR']); 
     387                if ($this->proxy_host) { 
     388                        $xforward[] = $_SERVER['SERVER_ADDR']; 
     389                } 
     390                $headers[] = 'X-Forwarded-For: '.implode(', ',$xforward); 
     391                 
    384392                # Basic authentication 
    385393                if ($this->username && $this->password) { 
    386                         $headers[] = 'Authorization: BASIC '.base64_encode($this->username.':'.$this->password); 
    387                 } 
     394                        $headers[] = 'Authorization: Basic '.base64_encode($this->username.':'.$this->password); 
     395                } 
     396                 
     397                $headers = array_merge($headers,$this->more_headers); 
    388398                 
    389399                # If this is a POST, set the content type and length 
     
    568578                $this->password = $password; 
    569579        } 
     580         
     581        /** 
     582        Sets additionnal header to be sent with the request. 
     583         
     584        @param  header  <b>string</b>           Full header definition 
     585        */ 
     586        public function setMoreHeader($header) 
     587        { 
     588                $this->more_headers[] = $header; 
     589        } 
     590         
     591        /** 
     592        Empty additionnal headers. 
     593        */ 
     594        public function voidMoreHeaders() 
     595        { 
     596                $this->more_headers = array(); 
     597        } 
     598         
    570599         
    571600        /** 
  • trunk/lib/clearbricks/VERSION

    r767 r1146  
    1 svn-96 
     1svn-192 
Download in other formats: Unified Diff Zip Archive