messua/layer/cors
Types
Values
pub fn allow_method(cfg: Config, method: http.Method) -> Config
pub fn make_layer(
cfg: Config,
) -> fn(
minc.Incoming(state),
fn(minc.Incoming(state)) -> Result(
response.Response(mist.ResponseData),
fail.Failure,
),
) -> Result(response.Response(mist.ResponseData), fail.Failure)
Make a CORS Layer with the given configuration.
pub fn new() -> Config
Create a new, maximally-restrictive CORS configuration:
- allows methods GET, POST, & HEAD
- no allowed origins
- no allowed headers
- no exposed headers
- credentials not allowed
- no statement about caching
These restrictions can be relaxed with the builder-pattern functions in this module.