namespace XFESystem.Browser; /// /// Platform HTTP/TLS boundary. Implementations must bound bytes, time and redirects /// and validate HTTPS chain, hostname and certificate validity before returning. /// public interface IWebTransport { WebResponse Get(Uri address, BrowserLimits limits); } /// /// Optional declaration of the explicitly injected backend's implementation. /// These flags do not assert that a link, IP address, peer or certificate is ready. /// Each request must still check its platform prerequisites and HTTPS validation. /// public interface IWebTransportCapabilities { bool IsNative { get; } bool SupportsHttp { get; } bool SupportsHttps { get; } } public sealed record WebResponse(Uri Address, int StatusCode, string ContentType, string Body, bool CertificateValidated = false, string? ContentSecurityPolicy = null, string? BodySha256 = null); public sealed class UnavailableWebTransport : IWebTransport, IWebTransportCapabilities { public bool IsNative => false; public bool SupportsHttp => false; public bool SupportsHttps => false; public WebResponse Get(Uri address, BrowserLimits limits) => throw new NotSupportedException("This runtime has no HTTP/TLS transport. Offline pages and JavaScript are available."); }