]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Profile.php
Merge pull request #11385 from annando/ap-receiver-unhandled
[friendica.git] / src / Model / Profile.php
index cb7fa65479513f7ea99967fcbd6c491d227ee9f2..85af2030013b7ba6d85b0b99f2c6c19e471bbcdd 100644 (file)
@@ -35,6 +35,8 @@ use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\DI;
+use Friendica\Network\HTTPClient\Client\HttpClient;
+use Friendica\Network\HTTPClient\Client\HttpClientOptions;
 use Friendica\Network\HTTPException;
 use Friendica\Protocol\Activity;
 use Friendica\Protocol\Diaspora;
@@ -362,7 +364,7 @@ class Profile
                }
 
                // Fetch the account type
-               $account_type = Contact::getAccountType($profile);
+               $account_type = Contact::getAccountType($profile['account-type']);
 
                if (!empty($profile['address']) || !empty($profile['location'])) {
                        $location = DI::l10n()->t('Location:');
@@ -749,7 +751,7 @@ class Profile
                        $magic_path = $basepath . '/magic' . '?owa=1&dest=' . $dest . '&' . $addr_request;
 
                        // We have to check if the remote server does understand /magic without invoking something
-                       $serverret = DI::httpClient()->get($basepath . '/magic');
+                       $serverret = DI::httpClient()->head($basepath . '/magic', [HttpClientOptions::ACCEPT_CONTENT => HttpClient::ACCEPT_HTML]);
                        if ($serverret->isSuccess()) {
                                Logger::info('Doing magic auth for visitor ' . $my_url . ' to ' . $magic_path);
                                System::externalRedirect($magic_path);