Interface IHtmlResourceResolver
Resolves a resource an HTML document references — an <img src> that is not a
data URI, or a linked stylesheet.
public interface IHtmlResourceResolver
Remarks
DocWright never fetches on its own. A document that names a URL is untrusted input
describing where to send a request, which is the shape of an SSRF: a converter running
inside a network can be made to reach hosts the caller cannot. There is no allow-list a
library can pick that is right for every host, so the decision belongs to the host and so
does the risk. Without a resolver a reference is reported (DXP2004) and dropped.
An implementation is called with the reference exactly as the document wrote it, resolved
against the document's <base href> when one was present. It should return
false for anything it declines rather than throwing; an exception
propagates out of the read.
Methods
- TryResolve(string, out HtmlResource)
Resolves a reference to bytes.