mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Merge pull request #364 from pixelfed/frontend-ui-refactor
Update Profile & Federation controllers, output proper AP content type
This commit is contained in:
commit
49e29ecd2f
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