use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
+use Friendica\Network\HTTPClient\Client\HttpClientAccept;
+use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Util\Strings;
function redir_init(App $a) {
}
// Test for magic auth on the target system
- $serverret = DI::httpClient()->head($basepath . '/magic');
+ $serverret = DI::httpClient()->head($basepath . '/magic', [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::HTML]);
if ($serverret->isSuccess()) {
$separator = strpos($target_url, '?') ? '&' : '?';
$target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);
{
$timeout = DI::config()->get('system', 'xrd_timeout');
- $curlResult = DI::httpClient()->head($url, $accept, [HttpClientOptions::TIMEOUT => $timeout]);
+ $curlResult = DI::httpClient()->head($url, [HttpClientOptions::TIMEOUT => $timeout, HttpClientOptions::ACCEPT_CONTENT => $accept]);
if ($curlResult->isSuccess()) {
if (empty($media['mimetype'])) {
return $curlResult->getHeader('Content-Type')[0] ?? '';