Class WebEgressFetcher
The fetch that honors WebEgressPolicy end to end: redirects are followed manually so EVERY hop re-enters validation, connections go to the hop's pinned addresses (a name cannot re-resolve to something private between check and connect), and the body is read from the decompressed stream under a hard byte cap.
public sealed class WebEgressFetcher
- Inheritance
-
WebEgressFetcher
- Inherited Members
Constructors
- WebEgressFetcher(WebEgressPolicy)
Creates a fetcher bound to
policy.
Properties
- RequestHeaders
Headers attached to every request the fetcher sends (an authorization token for a gated repository, for example). Names and values ride verbatim.
Methods
- FetchAsync(string, HttpMethod, CancellationToken)
Same gate, explicit method: HEAD serves metadata probes without pulling a body.
- FetchAsync(string, CancellationToken)
Fetches
urlunder the policy. Throws InvalidOperationException with the gate's own reason when any hop is refused, so callers surface an honest refusal instead of a transport error.
- FetchStreamAsync(string, CancellationToken)
Fetches
urlunder the policy and hands the caller the response STREAM instead of a buffered body: every redirect hop is validated and connects pinned exactly like FetchAsync(string, CancellationToken), and the policy's timeout bounds each hop up to response headers, but the body itself is read by the caller under its own cancellation and without the byte cap. Built for large artifact downloads that a buffering fetch cannot carry. Throws InvalidOperationException with the gate's own reason when any hop is refused.