7.1 IImageUrlFetcher
Add IImageUrlFetcher with HttpClient-backed implementation that enforces UrlFetch.TimeoutSeconds, MaxRedirects, and MaxBytes. Surfaces failures as ImageFetchException so the URL-ingestion endpoint can map them to 502. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -177,7 +177,7 @@ Each type lives in `src/FrameProcessor/Domain/`. Tests in `tests/FrameProcessor.
|
||||
|
||||
## Phase 7 — URL-fetch ingestion
|
||||
|
||||
### [ ] 7.1 `IImageUrlFetcher`
|
||||
### [x] 7.1 `IImageUrlFetcher`
|
||||
- Constructor takes `HttpClient` (via `IHttpClientFactory`) configured with `UrlFetch.TimeoutSeconds` and `MaxRedirects`.
|
||||
- `Task<Stream> FetchAsync(Uri, CancellationToken)` — streams response, aborts if content exceeds `MaxBytes`.
|
||||
- Throws a typed exception (`ImageFetchException`) for timeout / non-2xx / too-large / redirect-loop.
|
||||
|
||||
Reference in New Issue
Block a user