[backend/core] Don't run webfinger for local note urls (ISH-159)

This commit is contained in:
Laura Hausmann 2024-03-11 02:11:25 +01:00
parent b7ddbdcbaa
commit 794abcd727
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -116,6 +116,10 @@ public class UserResolver(
public async Task<User> ResolveAsync(string query)
{
query = NormalizeQuery(query);
// Before we begin, let's skip local note urls
if (query.StartsWith($"https://{config.Value.WebDomain}/notes/"))
throw GracefulException.BadRequest("Refusing to resolve local note URL as user");
// First, let's see if we already know the user
var user = await userSvc.GetUserFromQueryAsync(query);