clia / ntex-cors-mod

A modification for ntex-cors, not require a `ORIGIN` header to produce CORS header.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cors Middleware for ntex framework

Documentation & community resources

A loose config example

ntex-cors = { package = "clia-ntex-cors-mod", version = "0.2" }
.wrap(
    Cors::new()
        .allowed_methods(vec![
            "GET", "HEAD", "POST", "OPTIONS", "PUT", "PATCH", "DELETE",
        ])
        .send_wildcard()
        .finish(),
)

Will produce CORS headers for every request:

vary: Origin
access-control-allow-origin: *

About

A modification for ntex-cors, not require a `ORIGIN` header to produce CORS header.

License:MIT License


Languages

Language:Rust 100.0%