mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 19:51:47 +00:00
## Issue Addressed - Resolves #1766 ## Proposed Changes - Use the `warp::filters::cors` filter instead of our work-around. ## Additional Info It's not trivial to enable/disable `cors` using `warp`, since using `routes.with(cors)` changes the type of `routes`. This makes it difficult to apply/not apply cors at runtime. My solution has been to *always* use the `warp::filters::cors` wrapper but when cors should be disabled, just pass the HTTP server listen address as the only permissible origin.
7 lines
210 B
Rust
7 lines
210 B
Rust
//! This crate contains functions that are common across multiple `warp` HTTP servers in the
|
|
//! Lighthouse project. E.g., the `http_api` and `http_metrics` crates.
|
|
|
|
pub mod cors;
|
|
pub mod reject;
|
|
pub mod task;
|