mirror of
https://github.com/friendica/friendica
synced 2025-04-26 22:30:18 +00:00
Issue 10947: Send correct accept-header for AP
This commit is contained in:
parent
72a500ea08
commit
1219a4d00e
3 changed files with 9 additions and 13 deletions
|
@ -21,6 +21,7 @@
|
|||
|
||||
namespace Friendica\Protocol;
|
||||
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Model\APContact;
|
||||
use Friendica\Model\User;
|
||||
|
@ -80,9 +81,15 @@ class ActivityPub
|
|||
*/
|
||||
public static function isRequest()
|
||||
{
|
||||
return stristr($_SERVER['HTTP_ACCEPT'] ?? '', 'application/activity+json') ||
|
||||
$isrequest = stristr($_SERVER['HTTP_ACCEPT'] ?? '', 'application/activity+json') ||
|
||||
stristr($_SERVER['HTTP_ACCEPT'] ?? '', 'application/json') ||
|
||||
stristr($_SERVER['HTTP_ACCEPT'] ?? '', 'application/ld+json');
|
||||
|
||||
if ($isrequest) {
|
||||
Logger::debug('Is AP request', ['accept' => $_SERVER['HTTP_ACCEPT'], 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '']);
|
||||
}
|
||||
|
||||
return $isrequest;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue