send Cross-Origin-Resource-Policy: same-origin from SecurityHeadersMiddleware on every response
keep the existing CSP-only exemption for /docs and /openapi; CORP remains present there
cover API, artwork, IPTV, docs, and OpenAPI representative paths
record the global browser-embedding posture in docs/decisions.md
Compatibility reasoning
The WHATWG Fetch CORP algorithm and Chromium's CORP tests confirm that CORP applies to opaque/no-cors browser loads, not successful CORS-mode requests. The configured Api:CorsAllowedOrigins machine-client path therefore remains usable. Native/server-side clients such as Kodi, Dispatcharr, Jellyfin's backend, curl, and .NET do not enforce CORP.
The deliberate behavior change is that a browser may no longer embed ErsatzTV artwork/media directly from a different scheme, host, or port. The supported SPA path is same-origin.
The separate Kodi image failures were diagnosed as unstable/unreachable XMLTV URLs, not CORP. Findings are on timothy/server-management#501; local code hardening is tracked by #340.
TZ=UTC dotnet test ErsatzTV.sln --no-build -v minimal
pre-push: generated API drift check, ESLint, TypeScript typecheck, and Vite production build
Live-E2E is not required: this changes no mutating handler or SPA behavior.
Fixes #330
## Summary
- send `Cross-Origin-Resource-Policy: same-origin` from `SecurityHeadersMiddleware` on every response
- keep the existing CSP-only exemption for `/docs` and `/openapi`; CORP remains present there
- cover API, artwork, IPTV, docs, and OpenAPI representative paths
- record the global browser-embedding posture in `docs/decisions.md`
## Compatibility reasoning
The WHATWG Fetch CORP algorithm and Chromium's CORP tests confirm that CORP applies to opaque/`no-cors` browser loads, not successful CORS-mode requests. The configured `Api:CorsAllowedOrigins` machine-client path therefore remains usable. Native/server-side clients such as Kodi, Dispatcharr, Jellyfin's backend, curl, and .NET do not enforce CORP.
The deliberate behavior change is that a browser may no longer embed ErsatzTV artwork/media directly from a different scheme, host, or port. The supported SPA path is same-origin.
The separate Kodi image failures were diagnosed as unstable/unreachable XMLTV URLs, not CORP. Findings are on `timothy/server-management#501`; local code hardening is tracked by #340.
## Verification
- focused `SecurityHeadersMiddlewareTests`: 9/9 passed
- `TZ=UTC dotnet restore ErsatzTV.sln -v minimal`
- `TZ=UTC dotnet build ErsatzTV.sln --no-restore -v minimal` — 0 warnings, 0 errors
- `TZ=UTC dotnet test ErsatzTV.sln --no-build -v minimal`
- pre-push: generated API drift check, ESLint, TypeScript typecheck, and Vite production build
Live-E2E is not required: this changes no mutating handler or SPA behavior.
Cold independent security review completed with no findings.
- confirmed the unconditional middleware placement covers API, artwork, IPTV, static, streaming, error, docs, and OpenAPI responses
- confirmed Fetch/CORP semantics preserve successful configured CORS-mode requests and do not affect native/server-side clients
- confirmed the CSP-only exception does not suppress CORP on `/docs` or `/openapi`
- focused middleware suite passed 9/9
Review-verdict: MERGEABLE @ 2609b4ce593eeaf7203fb50c78feec030638984f
timothy
merged commit 2609b4ce59 into main2026-07-13 21:33:15 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #330
Summary
Cross-Origin-Resource-Policy: same-originfromSecurityHeadersMiddlewareon every response/docsand/openapi; CORP remains present theredocs/decisions.mdCompatibility reasoning
The WHATWG Fetch CORP algorithm and Chromium's CORP tests confirm that CORP applies to opaque/
no-corsbrowser loads, not successful CORS-mode requests. The configuredApi:CorsAllowedOriginsmachine-client path therefore remains usable. Native/server-side clients such as Kodi, Dispatcharr, Jellyfin's backend, curl, and .NET do not enforce CORP.The deliberate behavior change is that a browser may no longer embed ErsatzTV artwork/media directly from a different scheme, host, or port. The supported SPA path is same-origin.
The separate Kodi image failures were diagnosed as unstable/unreachable XMLTV URLs, not CORP. Findings are on
timothy/server-management#501; local code hardening is tracked by #340.Verification
SecurityHeadersMiddlewareTests: 9/9 passedTZ=UTC dotnet restore ErsatzTV.sln -v minimalTZ=UTC dotnet build ErsatzTV.sln --no-restore -v minimal— 0 warnings, 0 errorsTZ=UTC dotnet test ErsatzTV.sln --no-build -v minimalLive-E2E is not required: this changes no mutating handler or SPA behavior.
Cold independent security review completed with no findings.
/docsor/openapiReview-verdict: MERGEABLE @
2609b4ce59