Skip to content

Commit

Permalink
Update FederationController, return 404 for invalid webfinger address…
Browse files Browse the repository at this point in the history
…es. Fixes #2647
  • Loading branch information
dansup committed Feb 13, 2021
1 parent 723eb00 commit deb6f11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/FederationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public function webfinger(Request $request)

$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();
Expand Down

0 comments on commit deb6f11

Please sign in to comment.