mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-09 16:24:51 +00:00
Update web routes for AP actor object
This commit is contained in:
parent
d6970d930f
commit
0462b0a364
2 changed files with 18 additions and 3 deletions
|
@ -48,6 +48,23 @@ class ProfileController extends Controller
|
|||
return view('profile.show', compact('user', 'settings', 'owner', 'is_following', 'is_admin', 'timeline'));
|
||||
}
|
||||
|
||||
public function permalinkRedirect(Request $request, $username)
|
||||
{
|
||||
$user = Profile::whereUsername($username)->firstOrFail();
|
||||
$settings = User::whereUsername($username)->firstOrFail()->settings;
|
||||
|
||||
$mimes = [
|
||||
'application/activity+json',
|
||||
'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
|
||||
];
|
||||
|
||||
if(in_array($request->header('accept'), $mimes) && config('pixelfed.activitypub_enabled')) {
|
||||
return $this->showActivityPub($request, $user);
|
||||
}
|
||||
|
||||
return redirect($user->url());
|
||||
}
|
||||
|
||||
protected function privateProfileCheck(Profile $profile)
|
||||
{
|
||||
if(Auth::check() === false) {
|
||||
|
|
|
@ -123,9 +123,7 @@ Route::domain(config('pixelfed.domain.app'))->middleware('validemail')->group(fu
|
|||
Route::redirect('/', '/');
|
||||
Route::get('{user}.atom', 'ProfileController@showAtomFeed');
|
||||
Route::get('{username}/outbox', 'FederationController@userOutbox');
|
||||
Route::get('{user}', function($user) {
|
||||
return redirect('/'.$user);
|
||||
});
|
||||
Route::get('{username}', 'ProfileController@permalinkRedirect');
|
||||
});
|
||||
|
||||
Route::get('p/{username}/{id}/c/{cid}', 'CommentController@show');
|
||||
|
|
Loading…
Reference in a new issue