1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-23 08:14:10 +00:00

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 class ActivityPubFetchService
{ {
public static function get($url) public static function get($url, $validateUrl = true)
{ {
if(!Helpers::validateUrl($url)) { if($validateUrl === true) {
return 0; if(!Helpers::validateUrl($url)) {
} return 0;
}
}
$baseHeaders = [ $baseHeaders = [
'Accept' => 'application/activity+json, application/ld+json', 'Accept' => 'application/activity+json, application/ld+json',