mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update Profile & Federation controllers, output proper AP content type
This commit is contained in:
parent
a2d4b7c1fc
commit
4cf58e1539
2 changed files with 3 additions and 3 deletions
|
@ -118,7 +118,7 @@ class FederationController extends Controller
|
|||
{
|
||||
$this->validate($request, ['resource'=>'required|string|min:3|max:255']);
|
||||
|
||||
$hash = hash('sha512', $request->input('resource'));
|
||||
$hash = hash('sha256', $request->input('resource'));
|
||||
|
||||
$webfinger = Cache::remember('api:webfinger:'.$hash, 1440, function() use($request) {
|
||||
$resource = $request->input('resource');
|
||||
|
@ -141,7 +141,7 @@ class FederationController extends Controller
|
|||
$fractal = new Fractal\Manager();
|
||||
$resource = new Fractal\Resource\Item($user, new ProfileOutbox);
|
||||
$res = $fractal->createData($resource)->toArray();
|
||||
return response()->json($res['data']);
|
||||
return response(json_encode($res['data']))->header('Content-Type', 'application/activity+json');
|
||||
}
|
||||
|
||||
public function userInbox(Request $request, $username)
|
||||
|
|
|
@ -68,7 +68,7 @@ class ProfileController extends Controller
|
|||
$fractal = new Fractal\Manager();
|
||||
$resource = new Fractal\Resource\Item($user, new ProfileTransformer);
|
||||
$res = $fractal->createData($resource)->toArray();
|
||||
return response()->json($res['data']);
|
||||
return response(json_encode($res['data']))->header('Content-Type', 'application/activity+json');
|
||||
}
|
||||
|
||||
public function showAtomFeed(Request $request, $user)
|
||||
|
|
Loading…
Reference in a new issue