cors

Configure CORS settings for ColdBox REST APIs with origin validation.

1|Updated Apr 10, 2026
Ready to run
npx skills add https://github.com/ColdBox/skills --skill cors
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: cors
Source: https://github.com/ColdBox/skills/tree/main/modules/cors
Command: npx skills add https://github.com/ColdBox/skills --skill cors

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Configures and secures cross-origin requests for ColdBox REST APIs, preventing unauthorized front-end access while enabling legitimate front-end applications.

Core Features & Use Cases

  • Configure allowOrigins, allowMethods, allowHeaders, and allowCredentials to control CORS behavior in production and development.
  • Support for dynamic origin validation to allow specific origins based on environment or request context.
  • Preflight OPTIONS handling and production hardening to ensure safe cross-origin interactions.

Quick Start

Configure your ColdBox app by updating config/modules/cors.cfc with the allowed origins, methods, headers, and credentials to enable secure cross-origin requests.

Frequently Asked Questions about cors

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure CORS for a ColdBox REST API?▼

ColdBox REST APIs require CORS configuration to prevent unauthorized front-end access. You configure allowed origins, methods, headers, and credentials to securely enable legitimate cross-origin interactions.

How does preflight OPTIONS handling work for ColdBox cross-origin requests?▼

Preflight OPTIONS handling validates cross-origin requests before the actual API call occurs. It uses preflightMaxAge and allowed headers to ensure safe interactions during production and development.

Can I use dynamic origin validation for CORS in ColdBox?▼

Yes, dynamic origin validation allows specific origins based on environment or request context. This provides controlled cross-origin access for front-end applications requiring flexible security policies.

What CORS headers can I control for ColdBox REST APIs?▼

You can configure allowOrigins, allowMethods, allowHeaders, allowCredentials, and preflightMaxAge. These settings control cross-origin behavior and ensure production hardening for REST API interactions.

Why do I need to secure cross-origin requests for my REST API?▼

Securing cross-origin requests prevents unauthorized front-end applications from accessing your REST API. Controlled CORS configuration enables legitimate cross-origin access while blocking potentially malicious interactions.