]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Magic.php
Some more API functions moved
[friendica.git] / src / Module / Magic.php
index 45fde43f64657bc334958ca85eef3f2fac3908c6..c51c05844cbecadf9f5d5bd27e2b35b9f0fdcc84 100644 (file)
@@ -28,6 +28,7 @@ use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\User;
+use Friendica\Network\HTTPClient\Client\HttpClientOptions;
 use Friendica\Util\HTTPSignature;
 use Friendica\Util\Strings;
 
@@ -88,9 +89,10 @@ class Magic extends BaseModule
                        $exp = explode('/profile/', $contact['url']);
                        $basepath = $exp[0];
 
-                       $header = [];
-                       $header['Accept'] = 'application/x-dfrn+json, application/x-zot+json';
-                       $header['X-Open-Web-Auth'] = Strings::getRandomHex();
+                       $header = [
+                               'Accept'                  => ['application/x-dfrn+json', 'application/x-zot+json'],
+                               'X-Open-Web-Auth' => [Strings::getRandomHex()],
+                       ];
 
                        // Create a header that is signed with the local users private key.
                        $header = HTTPSignature::createSig(
@@ -100,7 +102,7 @@ class Magic extends BaseModule
                        );
 
                        // Try to get an authentication token from the other instance.
-                       $curlResult = DI::httpRequest()->get($basepath . '/owa', ['header' => $header]);
+                       $curlResult = DI::httpClient()->get($basepath . '/owa', [HttpClientOptions::HEADERS => $header]);
 
                        if ($curlResult->isSuccess()) {
                                $j = json_decode($curlResult->getBody(), true);