]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Magic.php
Merge pull request #9959 from annando/more-database-stuff
[friendica.git] / src / Module / Magic.php
index b65159585b85824e3f6b2dec7b72c92081724e56..af8ff3605639113a9cf1164eb6777082c01ba6a0 100644 (file)
@@ -27,7 +27,6 @@ use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Contact;
-use Friendica\Network\HTTPRequest;
 use Friendica\Util\HTTPSignature;
 use Friendica\Util\Strings;
 
@@ -89,19 +88,19 @@ class Magic extends BaseModule
                                $exp = explode('/profile/', $contact['url']);
                                $basepath = $exp[0];
 
-                               $headers = [];
-                               $headers['Accept'] = 'application/x-dfrn+json, application/x-zot+json';
-                               $headers['X-Open-Web-Auth'] = Strings::getRandomHex();
+                               $header = [];
+                               $header['Accept'] = 'application/x-dfrn+json, application/x-zot+json';
+                               $header['X-Open-Web-Auth'] = Strings::getRandomHex();
 
                                // Create a header that is signed with the local users private key.
-                               $headers = HTTPSignature::createSig(
-                                       $headers,
+                               $header = HTTPSignature::createSig(
+                                       $header,
                                        $user['prvkey'],
                                        'acct:' . $user['nickname'] . '@' . DI::baseUrl()->getHostname() . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : '')
                                );
 
                                // Try to get an authentication token from the other instance.
-                               $curlResult = HTTPRequest::curl($basepath . '/owa', false, ['headers' => $headers]);
+                               $curlResult = DI::httpRequest()->get($basepath . '/owa', ['header' => $header]);
 
                                if ($curlResult->isSuccess()) {
                                        $j = json_decode($curlResult->getBody(), true);