Skip to main content

Module cors

Module cors 

Source
Expand description

Generic CORS configuration.

This builder takes origins, methods, and headers as parameters — it has no opinion on which origins or headers a product allows. Product-specific header lists (e.g. Soma’s mcp-protocol-version) stay in the owning product crate and get passed in here.

Structs§

CorsLayer
Layer that applies the [Cors] middleware which adds headers for CORS.

Functions§

cors_layer
Build a CorsLayer that allows exactly the given origins, methods, and request headers. Callers own picking a sane (non-empty, non-wildcard when credentials matter) set of origins.