MDL-57161 search: Set the correct HTTP header
authorDavid Monllao <davidm@moodle.com>
Mon, 28 Nov 2016 01:57:32 +0000 (09:57 +0800)
committerSimey Lameze <simey@moodle.com>
Tue, 6 Dec 2016 01:52:30 +0000 (09:52 +0800)
All credit goes to Test Valley School

search/engine/solr/classes/engine.php

index 57fef71..50042c3 100644 (file)
@@ -1224,7 +1224,7 @@ class engine extends \core_search\engine {
 
         if (!empty($this->config->server_username) && !empty($this->config->server_password)) {
             $authorization = $this->config->server_username . ':' . $this->config->server_password;
-            $this->curl->setHeader('Authorization', 'Basic ' . base64_encode($authorization));
+            $this->curl->setHeader('AuthorizationBasic ' . base64_encode($authorization));
         }
 
         return $this->curl;