Browse Source

fix hdhr endpoint classification (#2101)

pull/2102/head
Jason Dove 1 year ago committed by GitHub
parent
commit
cd4a9c1d16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      CHANGELOG.md
  2. 13
      ErsatzTV/Startup.cs

3
CHANGELOG.md

@ -73,6 +73,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix display of SVG channel logo and watermark in admin UI - Fix display of SVG channel logo and watermark in admin UI
- Existing SVG logos and watermarks will have to be re-uploaded to display properly in the admin UI - Existing SVG logos and watermarks will have to be re-uploaded to display properly in the admin UI
- This does not affect streaming at all; existing artwork still works fine for streaming - This does not affect streaming at all; existing artwork still works fine for streaming
- Classify HDHR endpoints as streaming endpoints
- This allows these endpoints to be accessed through port `ETV_STREAMING_PORT` (default `8409`)
- This only matters if you configured `ETV_UI_PORT` to be a different value, which makes UI endpoints inaccessible on the streaming port
## [25.2.0] - 2025-06-24 ## [25.2.0] - 2025-06-24
### Added ### Added

13
ErsatzTV/Startup.cs

@ -562,7 +562,7 @@ public class Startup
async (context, next) => async (context, next) =>
{ {
if (!context.Request.Host.Value.StartsWith("localhost", StringComparison.OrdinalIgnoreCase) && if (!context.Request.Host.Value.StartsWith("localhost", StringComparison.OrdinalIgnoreCase) &&
!context.Request.Path.StartsWithSegments("/iptv") && !IsIptvPath(context.Request.Path) &&
context.Connection.LocalPort != Settings.UiPort) context.Connection.LocalPort != Settings.UiPort)
{ {
context.Response.StatusCode = 404; context.Response.StatusCode = 404;
@ -573,7 +573,7 @@ public class Startup
}); });
app.MapWhen( app.MapWhen(
ctx => !ctx.Request.Path.StartsWithSegments("/iptv"), ctx => !IsIptvPath(ctx.Request.Path),
blazor => blazor =>
{ {
blazor.UseRouting(); blazor.UseRouting();
@ -596,12 +596,19 @@ public class Startup
}); });
app.MapWhen( app.MapWhen(
ctx => ctx.Request.Path.StartsWithSegments("/iptv"), ctx => IsIptvPath(ctx.Request.Path),
iptv => iptv =>
{ {
iptv.UseRouting(); iptv.UseRouting();
iptv.UseEndpoints(endpoints => endpoints.MapControllers()); iptv.UseEndpoints(endpoints => endpoints.MapControllers());
}); });
return;
bool IsIptvPath(PathString path) => path.StartsWithSegments("/iptv") ||
path.StartsWithSegments("/discover.json") ||
path.StartsWithSegments("/device.xml") ||
path.StartsWithSegments("/lineup.json") ||
path.StartsWithSegments("/lineup_status.json");
} }
private static void CustomServices(IServiceCollection services) private static void CustomServices(IServiceCollection services)

Loading…
Cancel
Save