Add to the MediaRoute table (SpikerSoft.Api/Extensions/ServiceCollectionExtensions.cs:~1136):
new MediaRoute("/destination-images", sp.GetRequiredKeyedService<IObjectStore>("assets"), "destinations", ServeUnknownTypes: false)
Extend MediaRoute/S3MediaFallbackMiddleware with an optional CacheControl field; set public, max-age=604800 here (images are immutable-by-name). Existing routes keep current behavior.
GET/HEAD only, 404 fail-soft, path hardening — all inherited from the middleware; add tests mirroring the existing middleware suite for the new prefix + cache header.
Serves objects Joey uploads to assets/destinations/{code}.avif (spec in #868).
Part of #868 (PR-1, backend).
Add to the `MediaRoute` table (`SpikerSoft.Api/Extensions/ServiceCollectionExtensions.cs:~1136`):
`new MediaRoute("/destination-images", sp.GetRequiredKeyedService<IObjectStore>("assets"), "destinations", ServeUnknownTypes: false)`
- Extend `MediaRoute`/`S3MediaFallbackMiddleware` with an optional `CacheControl` field; set `public, max-age=604800` here (images are immutable-by-name). Existing routes keep current behavior.
- GET/HEAD only, 404 fail-soft, path hardening — all inherited from the middleware; add tests mirroring the existing middleware suite for the new prefix + cache header.
- Serves objects Joey uploads to `assets/destinations/{code}.avif` (spec in #868).
Resolved in spikersoft-backend PR #497 (the consolidated family-card epic PR, merged to master, c8f692d7). The standalone PR #493 was closed unmerged in favour of that consolidation. Verified against origin/master:
ServiceCollectionExtensions.cs:1153 — route registered against the keyed "assets" store with prefix destinations, ServeUnknownTypes: false, CacheControl: "public, max-age=604800".
Tests in S3MediaFallbackMiddlewareTests.cs: serves with the header (:201), no header on miss (:223), existing routes unchanged (:244), plus GET/HEAD, path-traversal and fail-soft coverage at :94, :171, :187.
Closing.
Resolved in spikersoft-backend PR #497 (the consolidated family-card epic PR, merged to `master`, `c8f692d7`). The standalone PR #493 was closed unmerged in favour of that consolidation. Verified against `origin/master`:
- `S3MediaFallbackMiddleware.cs:13` — `MediaRoute(..., string? CacheControl = null)`; header emitted at `:83-85`.
- `ServiceCollectionExtensions.cs:1153` — route registered against the keyed `"assets"` store with prefix `destinations`, `ServeUnknownTypes: false`, `CacheControl: "public, max-age=604800"`.
- Tests in `S3MediaFallbackMiddlewareTests.cs`: serves with the header (`:201`), no header on miss (`:223`), existing routes unchanged (`:244`), plus GET/HEAD, path-traversal and fail-soft coverage at `:94`, `:171`, `:187`.
Closing.
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.
Part of #868 (PR-1, backend).
Add to the
MediaRoutetable (SpikerSoft.Api/Extensions/ServiceCollectionExtensions.cs:~1136):new MediaRoute("/destination-images", sp.GetRequiredKeyedService<IObjectStore>("assets"), "destinations", ServeUnknownTypes: false)MediaRoute/S3MediaFallbackMiddlewarewith an optionalCacheControlfield; setpublic, max-age=604800here (images are immutable-by-name). Existing routes keep current behavior.assets/destinations/{code}.avif(spec in #868).Resolved in spikersoft-backend PR #497 (the consolidated family-card epic PR, merged to
master,c8f692d7). The standalone PR #493 was closed unmerged in favour of that consolidation. Verified againstorigin/master:S3MediaFallbackMiddleware.cs:13—MediaRoute(..., string? CacheControl = null); header emitted at:83-85.ServiceCollectionExtensions.cs:1153— route registered against the keyed"assets"store with prefixdestinations,ServeUnknownTypes: false,CacheControl: "public, max-age=604800".S3MediaFallbackMiddlewareTests.cs: serves with the header (:201), no header on miss (:223), existing routes unchanged (:244), plus GET/HEAD, path-traversal and fail-soft coverage at:94,:171,:187.Closing.