salvo-cors

Configure CORS rules and security headers for Salvo applications.

20|5|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/salvo-rs/salvo-skills --skill salvo-cors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: salvo-cors
Source: https://github.com/salvo-rs/salvo-skills/tree/main/skills/salvo-cors
Command: npx skills add https://github.com/salvo-rs/salvo-skills --skill salvo-cors

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Configures Cross-Origin Resource Sharing (CORS) rules and security headers for Salvo-based APIs to enable safe cross-origin access.

Core Features & Use Cases

  • CORS configuration: specify allowed origins, methods, and headers for browser clients.
  • Security headers: set CSP, HSTS, and other headers to improve resilience.
  • Use Case: API services consumed by frontend apps hosted on different domains.

Quick Start

Configure a Cors handler in your Salvo router to allow trusted origins and secure defaults.

Frequently Asked Questions about salvo-cors

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

FAQPage Schema
How do I configure CORS in a Salvo web API to allow cross-origin requests?

To configure CORS in a Salvo web API, you apply a Cors handler to your router, specifying allowed origins, methods, and headers for safe browser access. It supports both global and route-level configurations.

What security headers should I set for cross-origin resource sharing in production?

For cross-origin resource sharing in production, you should set security headers like CSP and HSTS to improve resilience. This Salvo Skill configures these headers alongside CORS rules to secure API services.

Can I scope CORS rules to specific routes instead of applying them globally?

Yes, you can scope CORS rules to specific routes. This Skill supports route-scoped options, allowing you to apply permissive presets or custom configurations to individual endpoints rather than just globally.

How does preflight caching work for cross-origin requests in Salvo?

Preflight caching for cross-origin requests in Salvo works by storing browser preflight responses to optimize subsequent requests. This Skill supports preflight caching to reduce overhead for allowed origins, methods, and headers.

What is the best way to handle credentials in CORS for a Salvo application?

The best way to handle credentials in CORS for a Salvo application is to explicitly configure them within the Cors handler. This Skill allows you to specify credential support alongside origins and methods to secure browser access.

Why are my frontend app's cross-origin API requests failing on different domains?

Cross-origin API requests fail when CORS rules are not configured for frontend apps on different domains. Applying this Skill's Cors handler to your Salvo router sets the necessary allowed origins and headers to enable safe access.