Update ActivityPubFetchService, add validateUrl parameter to bypass url validation to fetch content from blocked instances

This commit is contained in:
Daniel Supernault 2023-08-01 03:16:08 -06:00
parent f2dfe12ac3
commit 3d1b6516fe
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -11,11 +11,13 @@ use Illuminate\Http\Client\RequestException;
class ActivityPubFetchService
{
public static function get($url)
public static function get($url, $validateUrl = true)
{
if(!Helpers::validateUrl($url)) {
return 0;
}
if($validateUrl === true) {
if(!Helpers::validateUrl($url)) {
return 0;
}
}
$baseHeaders = [
'Accept' => 'application/activity+json, application/ld+json',