Merge pull request #364 from pixelfed/frontend-ui-refactor

Update Profile & Federation controllers, output proper AP content type
This commit is contained in:
daniel 2018-08-12 21:27:01 -06:00 committed by GitHub
commit 49e29ecd2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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)

View file

@ -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)