Fix NormalizeQuery

This commit is contained in:
Laura Hausmann 2024-01-12 19:25:32 +01:00
parent 7cb1d7a5b6
commit bb1f4e6e27
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 2 additions and 1 deletions

View file

@ -66,7 +66,7 @@ public class UserResolver(ILogger<UserResolver> logger, UserService userSvc, Dat
return (finalAcct, finalUri);
}
private static string NormalizeQuery(string query) => query.StartsWith("acct:") ? query[5..] : query;
private static string NormalizeQuery(string query) => query.StartsWith('@') ? $"acct:{query[1..]}" : query;
public async Task<User> Resolve(string query) {
query = NormalizeQuery(query);

View file

@ -30,6 +30,7 @@ builder.Services.AddViteServices(options => {
options.Server.AutoRun = false; //TODO: Fix script generation on macOS
options.Server.UseFullDevUrl = true;
});
//TODO: single line only if there's no \n in the log msg (otherwise stacktraces don't work)
builder.Services.AddLogging(logging => logging.AddSimpleConsole(options => { options.SingleLine = true; }));
builder.Services.AddDbContext<DatabaseContext>();