mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 21:13:16 +00:00
24 lines
No EOL
512 B
PHP
24 lines
No EOL
512 B
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use Zttp\Zttp;
|
|
use App\Profile;
|
|
use App\Util\ActivityPub\Helpers;
|
|
use App\Util\ActivityPub\HttpSignature;
|
|
|
|
class ActivityPubFetchService
|
|
{
|
|
public static function get($url)
|
|
{
|
|
$headers = HttpSignature::instanceActorSign($url, false, [
|
|
'Accept' => 'application/activity+json, application/json',
|
|
'User-Agent' => '(Pixelfed/'.config('pixelfed.version').'; +'.config('app.url').')'
|
|
]);
|
|
|
|
return Zttp::withHeaders($headers)
|
|
->timeout(30)
|
|
->get($url)
|
|
->body();
|
|
}
|
|
} |