IResourceLoadingOptions

IResourceLoadingOptions interface

Controls how resources referenced from outside a document (remote URLs, UNC paths, local files) are loaded while the document is processed.

public interface IResourceLoadingOptions

Properties

Name Description
ExternalResourceHandler { get; set; } Handler that is called for every external resource before it is loaded and can allow, skip or replace it. Default value is null.
SkipExternalResources { get; set; } If true, no external resource is loaded except those matching WhitelistedResources or allowed by ExternalResourceHandler. Default value is true.
WhitelistedResources { get; set; } Absolute URI prefixes of external resources that are loaded while SkipExternalResources is true, for example https://cdn.example.com/assets/ or file:///C:/assets/.

Remarks

External resources are not loaded unless the caller allows them: loading a remote or local resource named by an untrusted document can reach internal network addresses, leak Windows credentials through UNC paths, or copy local files into the output. Content carried inside the document (data: and cid: references, packaged parts) is not external and still loads.

See Also