Explorar o código

Update HttpSignature

Daniel Supernault %!s(int64=2) %!d(string=hai) anos
pai
achega
9ffe5941d7
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      app/Services/ActivityPubFetchService.php

+ 7 - 1
app/Services/ActivityPubFetchService.php

@@ -17,8 +17,14 @@ class ActivityPubFetchService
 			return 0;
 		}
 
-		$headers = HttpSignature::instanceActorSign($url, false);
+		$baseHeaders = [
+			'Accept' => 'application/activity+json',
+			'User-Agent' => '(Pixelfed/'.config('pixelfed.version').'; +'.config('app.url').')'
+		];
+
+		$headers = HttpSignature::instanceActorSign($url, false, $baseHeaders);
 		$headers['Accept'] = 'application/activity+json';
+		$headers['User-Agent'] = '(Pixelfed/'.config('pixelfed.version').'; +'.config('app.url').')';
 
 		try {
 			$res = Http::withHeaders($headers)