Changeset 1146 for trunk/lib/clearbricks
- Timestamp:
- 11/04/08 11:13:45 (2 months ago)
- Files:
-
- trunk/lib/clearbricks/net.http/class.net.http.php (modified) (3 diffs)
- trunk/lib/clearbricks/VERSION (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/clearbricks/net.http/class.net.http.php
r767 r1146 68 68 protected $accept_language = 'en-us'; ///< <b>string</b> HTTP accept language 69 69 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 70 71 protected $timeout = 10; ///< <b>integer</b> Connection timeout 71 72 protected $use_ssl = false; ///< <b>boolean</b> Use SSL connection … … 382 383 } 383 384 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 384 392 # Basic authentication 385 393 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); 388 398 389 399 # If this is a POST, set the content type and length … … 568 578 $this->password = $password; 569 579 } 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 570 599 571 600 /** trunk/lib/clearbricks/VERSION
r767 r1146 1 svn- 961 svn-192
