Securitywarn by defaultrecommended preset
astro-doctor/no-open-allowed-domainsno-open-allowed-domains
Configure explicit trusted host patterns instead of allowing every domain.
Why
An empty allowed-domain pattern matches every host and defeats the protection that security.allowedDomains is intended to provide. List the exact hostnames or constrained wildcard patterns that should be trusted.
Examples
Incorrect
Every domain is allowed
export default defineConfig({
security: {
allowedDomains: [{}],
},
})Correct
Allow an explicit trusted hostname
export default defineConfig({
security: {
allowedDomains: [
{ hostname: 'www.example.com', protocol: 'https' },
],
},
})Configuration
Project audits are configured in doctor.config.ts:
export default {
rules: {
'astro-doctor/no-open-allowed-domains': 'error', // or 'warn' or 'off'
},
}All rules
astro-doctor/no-client-load-overuseastro-doctor/use-astro-imageastro-doctor/require-image-dimensionsastro-doctor/no-missing-altastro-doctor/no-set-htmlastro-doctor/no-public-secret-envastro-doctor/prefer-class-listastro-doctor/no-blocking-scriptastro-doctor/no-unprocessed-script-surprisesastro-doctor/no-missing-langastro-doctor/require-island-fallbackastro-doctor/no-process-envastro-doctor/prefer-content-collectionsastro-doctor/no-disabled-origin-checkastro-doctor/no-insecure-session-cookieastro-doctor/no-open-allowed-domains(this page)astro-doctor/prefer-env-schemaastro-doctor/prefer-pnpmastro-doctor/require-action-input-schemaastro-doctor/require-client-router-script-lifecycleastro-doctor/require-content-config