Browse Source

update iptv routing (#1631)

pull/1632/head
Jason Dove 2 years ago committed by GitHub
parent
commit
99cd01f73b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 39
      ErsatzTV/Startup.cs

1
CHANGELOG.md

@ -53,6 +53,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -53,6 +53,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Search index updates should now complete at the same time as library scans
- Do not unnecessarily update the search index during media server library scans
- Use different library for reading song metadata that supports multiple tag entries
- Update `/iptv` routing to make UI completely inaccessible from that path prefix
## [0.8.5-beta] - 2024-01-30
### Added

39
ErsatzTV/Startup.cs

@ -531,23 +531,38 @@ public class Startup @@ -531,23 +531,38 @@ public class Startup
// ServeUnknownFileTypes = true
});
app.UseRouting();
app.MapWhen(
ctx => !ctx.Request.Path.StartsWithSegments("/iptv"),
blazor =>
{
blazor.UseRouting();
if (OidcHelper.IsEnabled)
{
app.UseAuthentication();
app.UseAuthorization();
}
if (OidcHelper.IsEnabled)
{
blazor.UseAuthentication();
#pragma warning disable ASP0001
blazor.UseAuthorization();
#pragma warning restore ASP0001
}
blazor.UseEndpoints(
endpoints =>
{
endpoints.MapControllers();
endpoints.MapBlazorHub();
endpoints.MapFallbackToPage("/_Host");
});
});
app.UseEndpoints(
endpoints =>
app.MapWhen(
ctx => ctx.Request.Path.StartsWithSegments("/iptv"),
iptv =>
{
endpoints.MapControllers();
endpoints.MapBlazorHub();
endpoints.MapFallbackToPage("/_Host");
iptv.UseRouting();
iptv.UseEndpoints(endpoints => endpoints.MapControllers());
});
}
private static void CustomServices(IServiceCollection services)
{
services.AddSingleton<IPlexSecretStore, PlexSecretStore>();

Loading…
Cancel
Save