UserController: fall back to frontend when user isn't found
Fixes #2730 (closed)
When /users/:nickname
is accessed through the browser and a user is found, it renders the frontend with metadata.
When a user isn't found (or is remote), it returns a JSON response like this:
Returning JSON in this case is not the desired behavior. We want it to fall back on the frontend so it can render a "Not found" page there, or render the remote user. This fixes that behavior, and it's needed for Groups to function properly.
When the format is "json"
or "activity+json"
, it continue to render a 404 as expected.