Update FederationController, return 404 for invalid webfinger addresses. Fixes #2647

This commit is contained in:
Daniel Supernault 2021-02-12 21:44:06 -07:00
parent 723eb00039
commit deb6f1153f
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 2 additions and 2 deletions

View File

@ -53,8 +53,8 @@ class FederationController extends Controller
$resource = $request->input('resource');
$parsed = Nickname::normalizeProfileUrl($resource);
if($parsed['domain'] !== config('pixelfed.domain.app')) {
abort(400);
if(empty($parsed) || $parsed['domain'] !== config('pixelfed.domain.app')) {
abort(404);
}
$username = $parsed['username'];
$profile = Profile::whereNull('domain')->whereUsername($username)->firstOrFail();