mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
elofgren: VAR FIX: Prevent 'auth' from being undefined in HTTP::sendRequest()
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41941 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
180c06fd15
commit
56853999bb
@ -208,8 +208,11 @@ class HTTP {
|
||||
if( $query )
|
||||
$query = '?' . $query;
|
||||
|
||||
if( self::$userName && self::$password )
|
||||
if( self::$userName && self::$password ) {
|
||||
$auth = "Authorization: Basic " . base64_encode( self::$userName . ':' . self::$password ) . "\r\n";
|
||||
} else {
|
||||
$auth = '';
|
||||
}
|
||||
|
||||
$request = "GET {$path}{$query} HTTP/1.1\r\nHost: $host\r\nConnection: Close\r\n{$auth}\r\n";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user