assertPublicHttpUrl
function assertPublicHttpUrl(target: string): void;Guard an address before fetching it. Only public web pages are ever wanted, so require http(s) and reject private, loopback, and link-local hosts.
Exported because a source that accepts an address from its own configuration should refuse a bad one when it is entered, not on the first sync.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
target | string | The address about to be fetched. |
Returns
Section titled “Returns”void
Nothing; it throws when the target is not a public web page.