Update http client

pull/4737/head
Daniel Supernault 2023-11-06 02:08:51 -07:00
rodzic a3fd0b032b
commit c7b304ef20
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 23740873EE6F76A1
4 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -193,7 +193,7 @@ class InboxValidator implements ShouldQueue
}
try {
$res = Http::timeout(20)->withHeaders([
$res = Http::withOptions(['allow_redirects' => false])->timeout(20)->withHeaders([
'Accept' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
'User-Agent' => 'PixelfedBot v0.1 - https://pixelfed.org',
])->get($actor->remote_url);

Wyświetl plik

@ -173,7 +173,7 @@ class InboxWorker implements ShouldQueue
}
try {
$res = Http::timeout(20)->withHeaders([
$res = Http::withOptions(['allow_redirects' => false])->timeout(20)->withHeaders([
'Accept' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
'User-Agent' => 'PixelfedBot v0.1 - https://pixelfed.org',
])->get($actor->remote_url);

Wyświetl plik

@ -90,7 +90,7 @@ class StatusRemoteUpdatePipeline implements ShouldQueue
]);
$nm->each(function($n, $key) use($status) {
$res = Http::retry(3, 100, throw: false)->head($n['url']);
$res = Http::withOptions(['allow_redirects' => false])->retry(3, 100, throw: false)->head($n['url']);
if(!$res->successful()) {
return;

Wyświetl plik

@ -28,7 +28,7 @@ class ActivityPubFetchService
$headers['User-Agent'] = 'PixelFedBot/1.0.0 (Pixelfed/'.config('pixelfed.version').'; +'.config('app.url').')';
try {
$res = Http::withHeaders($headers)
$res = Http::withOptions(['allow_redirects' => false])->withHeaders($headers)
->timeout(30)
->connectTimeout(5)
->retry(3, 500)