mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update ActivityPubFetchService, add validateUrl parameter to bypass url validation to fetch content from blocked instances
This commit is contained in:
parent
f2dfe12ac3
commit
3d1b6516fe
1 changed files with 6 additions and 4 deletions
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue