Routes other sites' images through the API's image proxy, GET /api/remote/image, for Thumbnail and ThumbnailPlaceholder.

Functions

f
canProxyImage(url: string): boolean

Checks whether url points at another site, where proxying it could help. Thumbnail retries through the proxy only then, since the site's own files and thumbnails would fail the same way again.

f
proxyImageUrl(
url: string,
opts?: ProxyImageOptions
): string

Returns url routed through GET /api/remote/image, or unchanged when it needs no proxy. Only an HTTP URL is proxied by default, so that an HTTPS page doesn't block it as mixed content. A relative or localhost URL is never proxied.

Interfaces

I
ProxyImageOptions

Passed to proxyImageUrl by Thumbnail to retry a failed image.

  • force: boolean

    Proxies an HTTPS URL too, for a retry after a direct load failed, usually on hotlink protection.