isRemoteAllowed() — astro Function Reference
Architecture documentation for the isRemoteAllowed() function in assets.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD e50042db_4b08_3e65_8e4d_9c6bca588b7a["isRemoteAllowed()"] 8e71015c_a9d5_1a10_cdd9_b37b3d71b846["assets.ts"] e50042db_4b08_3e65_8e4d_9c6bca588b7a -->|defined in| 8e71015c_a9d5_1a10_cdd9_b37b3d71b846 style e50042db_4b08_3e65_8e4d_9c6bca588b7a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/integrations/cloudflare/src/utils/assets.ts lines 5–19
export function isRemoteAllowed(
src: string,
{
domains = [],
remotePatterns = [],
}: Partial<Pick<AstroConfig['image'], 'domains' | 'remotePatterns'>>,
): boolean {
if (!isRemotePath(src)) return false;
const url = new URL(src);
return (
domains.some((domain) => matchHostname(url, domain)) ||
remotePatterns.some((remotePattern) => matchPattern(url, remotePattern))
);
}
Domain
Subdomains
Source
Frequently Asked Questions
What does isRemoteAllowed() do?
isRemoteAllowed() is a function in the astro codebase, defined in packages/integrations/cloudflare/src/utils/assets.ts.
Where is isRemoteAllowed() defined?
isRemoteAllowed() is defined in packages/integrations/cloudflare/src/utils/assets.ts at line 5.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free