Browse Source

Update AP helpers, update user agent

Daniel Supernault 5 năm trước cách đây
mục cha
commit
155e960f54
1 tập tin đã thay đổi với 3 bổ sung5 xóa
  1. 3 5
      app/Util/ActivityPub/Helpers.php

+ 3 - 5
app/Util/ActivityPub/Helpers.php

@@ -181,9 +181,11 @@ class Helpers {
 
 
 	public static function zttpUserAgent()
 	public static function zttpUserAgent()
 	{
 	{
+		$version = config('pixelfed.version');
+		$url = config('app.url');
 		return [
 		return [
 			'Accept'     => 'application/activity+json',
 			'Accept'     => 'application/activity+json',
-			'User-Agent' => 'PixelfedBot - https://pixelfed.org',
+			'User-Agent' => "(Pixelfed/{$version}; +{$url})",
 		];
 		];
 	}
 	}
 
 
@@ -236,10 +238,6 @@ class Helpers {
 				$activity = ['object' => $res];
 				$activity = ['object' => $res];
 			}
 			}
 
 
-			if(isset($activity['object']['content']) == false) {
-				abort(400, 'Invalid object');
-			}
-
 			$scope = 'private';
 			$scope = 'private';
 			
 			
 			$cw = isset($res['sensitive']) ? (bool) $res['sensitive'] : false;
 			$cw = isset($res['sensitive']) ? (bool) $res['sensitive'] : false;