[backend/asp] Add explicit routes for matching local and remote users
This is necessary because MapFallbackToPage doesn't apply to routes containing special characters (dots, @ symbol) by default.
This commit is contained in:
parent
581d13bd65
commit
3d15ed6807
2 changed files with 9 additions and 2 deletions
|
@ -46,6 +46,13 @@ public static class WebApplicationExtensions
|
|||
return app;
|
||||
}
|
||||
|
||||
public static void MapFrontendRoutes(this WebApplication app, string page)
|
||||
{
|
||||
app.MapFallbackToPage(page).WithOrder(int.MaxValue - 2);
|
||||
app.MapFallbackToPage("/@{user}", page).WithOrder(int.MaxValue - 1);
|
||||
app.MapFallbackToPage("/@{user}@{host}", page);
|
||||
}
|
||||
|
||||
public static async Task<Config.InstanceSection> Initialize(this WebApplication app, string[] args)
|
||||
{
|
||||
var instanceConfig = app.Configuration.GetSection("Instance").Get<Config.InstanceSection>() ??
|
||||
|
|
|
@ -69,7 +69,7 @@ app.MapFallbackToController("/api/{**slug}", "FallbackAction", "Fallback");
|
|||
app.MapHub<ExampleHub>("/hubs/example");
|
||||
app.MapHub<StreamingHub>("/hubs/streaming");
|
||||
app.MapRazorPages();
|
||||
app.MapFallbackToPage("/Shared/FrontendSPA");
|
||||
app.MapFrontendRoutes("/Shared/FrontendSPA");
|
||||
|
||||
app.Urls.Clear();
|
||||
if (config.ListenSocket == null)
|
||||
|
|
Loading…
Add table
Reference in a new issue