From 0175b4a60541e63378b59c041827a970855663a9 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 28 Mar 2026 05:30:18 -0600 Subject: [PATCH] Lint --- app/Console/Commands/UserAccountDelete.php | 20 +++++--------------- app/Util/ActivityPub/HttpSignature.php | 1 + 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/app/Console/Commands/UserAccountDelete.php b/app/Console/Commands/UserAccountDelete.php index f3ee11a71..521eadd0d 100644 --- a/app/Console/Commands/UserAccountDelete.php +++ b/app/Console/Commands/UserAccountDelete.php @@ -291,21 +291,16 @@ class UserAccountDelete extends Command $appUrl = config('app.url'); $userAgent = "(Pixelfed/{$version}; +{$appUrl})"; - $requests = function () use ($client, $urls, $digest, $payload, $userAgent) { + $requests = function () use ($client, $urls, $digest, $payload) { foreach ($urls as $url) { $headers = HttpSignature::instanceActorSignWithDigest($url, $digest, [ 'Content-Type' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', ]); - $headers['User-Agent'] = $userAgent; - yield function () use ($client, $url, $headers, $payload) { return $client->postAsync($url, [ - 'curl' => [ - CURLOPT_HTTPHEADER => $headers, - CURLOPT_POSTFIELDS => $payload, - CURLOPT_HEADER => true, - ], + 'headers' => $headers, + 'body' => $payload, ]); }; } @@ -361,8 +356,6 @@ class UserAccountDelete extends Command 'Content-Type' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', ]); - $headers['User-Agent'] = $userAgent; - $this->info('Target: '.$url); $this->newLine(); @@ -385,11 +378,8 @@ class UserAccountDelete extends Command try { $response = $client->post($url, [ - 'curl' => [ - CURLOPT_HTTPHEADER => $headers, - CURLOPT_POSTFIELDS => $payload, - CURLOPT_HEADER => true, - ], + 'headers' => $headers, + 'body' => $payload, ]); $status = $response->getStatusCode(); diff --git a/app/Util/ActivityPub/HttpSignature.php b/app/Util/ActivityPub/HttpSignature.php index 3a3650d44..7464ac890 100644 --- a/app/Util/ActivityPub/HttpSignature.php +++ b/app/Util/ActivityPub/HttpSignature.php @@ -186,6 +186,7 @@ class HttpSignature $signatureHeader = 'keyId="'.$keyId.'",headers="'.$signedHeaders.'",algorithm="rsa-sha256",signature="'.$signature.'"'; unset($headers['(request-target)']); + unset($headers['Host']); $headers['Signature'] = $signatureHeader; return $headers;