Commit eed1f2e5 authored by Bas de Nooijer's avatar Bas de Nooijer

Merge commit '33a16826' into develop

parents b33c09bf 33a16826
...@@ -138,6 +138,11 @@ class Solarium_Client_Adapter_Curl extends Solarium_Client_Adapter ...@@ -138,6 +138,11 @@ class Solarium_Client_Adapter_Curl extends Solarium_Client_Adapter
$options['headers']['Content-Type'] = 'text/xml; charset=utf-8'; $options['headers']['Content-Type'] = 'text/xml; charset=utf-8';
} }
if ( isset( $this->_options['username']) && isset( $this->_options['password'])) {
curl_setopt($handler, CURLOPT_USERPWD, $this->_options['username']. ':' . $this->_options['password'] );
curl_setopt($handler, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
}
if (count($options['headers'])) { if (count($options['headers'])) {
$headers = array(); $headers = array();
foreach ($options['headers'] as $key => $value) { foreach ($options['headers'] as $key => $value) {
......
...@@ -121,6 +121,12 @@ class Solarium_Client_Adapter_Http extends Solarium_Client_Adapter ...@@ -121,6 +121,12 @@ class Solarium_Client_Adapter_Http extends Solarium_Client_Adapter
); );
} }
if ( isset( $this->_options['username']) && isset( $this->_options['password'])) {
$request->addHeader('Authorization: Basic ' . base64_encode($this->_options['username']. ':' . $this->_options['password'] ));
}
return $context; return $context;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment