From 3d1b6516feff975f84af951d47fc8a2cb63ffe1a Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 1 Aug 2023 03:16:08 -0600 Subject: [PATCH] Update ActivityPubFetchService, add validateUrl parameter to bypass url validation to fetch content from blocked instances --- app/Services/ActivityPubFetchService.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Services/ActivityPubFetchService.php b/app/Services/ActivityPubFetchService.php index d0accdcd..3d1980a1 100644 --- a/app/Services/ActivityPubFetchService.php +++ b/app/Services/ActivityPubFetchService.php @@ -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',