1
0
Fork 0
forked from mirror/pixelfed

Update AP deliver job

This commit is contained in:
Daniel Supernault 2019-03-07 23:10:28 -07:00
parent d28a5ea67f
commit d7d47ca132
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -76,11 +76,11 @@ class StatusActivityPubDeliver implements ShouldQueue
'timeout' => config('pixelfed.ap_delivery_timeout') 'timeout' => config('pixelfed.ap_delivery_timeout')
]); ]);
$requests = function() use ($client, $activity, $profile, $payload) { $requests = function() use ($audience, $client, $activity, $profile, $payload) {
foreach($audience as $url) { foreach($audience as $url) {
$headers = HttpSignature::sign($profile, $url, $activity); $headers = HttpSignature::sign($profile, $url, $activity);
yield function() use ($client, $url, $activity, $headers, $payload) { yield function() use ($client, $url, $headers, $payload) {
return $client->requestAsync('POST', $url, [ return $client->postAsync($url, [
'curl' => [ 'curl' => [
CURLOPT_HTTPHEADER => $headers, CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $payload, CURLOPT_POSTFIELDS => $payload,