kopia lustrzana https://github.com/friendica/friendica
head fixings
rodzic
277cd51433
commit
8e2cc678dc
|
@ -27,6 +27,8 @@ use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
|
||||||
|
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
function redir_init(App $a) {
|
function redir_init(App $a) {
|
||||||
|
@ -142,7 +144,7 @@ function redir_magic($a, $cid, $url)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test for magic auth on the target system
|
// 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()) {
|
if ($serverret->isSuccess()) {
|
||||||
$separator = strpos($target_url, '?') ? '&' : '?';
|
$separator = strpos($target_url, '?') ? '&' : '?';
|
||||||
$target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);
|
$target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);
|
||||||
|
|
|
@ -101,7 +101,7 @@ class Link
|
||||||
{
|
{
|
||||||
$timeout = DI::config()->get('system', 'xrd_timeout');
|
$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 ($curlResult->isSuccess()) {
|
||||||
if (empty($media['mimetype'])) {
|
if (empty($media['mimetype'])) {
|
||||||
return $curlResult->getHeader('Content-Type')[0] ?? '';
|
return $curlResult->getHeader('Content-Type')[0] ?? '';
|
||||||
|
|
Ładowanie…
Reference in New Issue