[][src]Function warp::filters::header::exact

pub fn exact(
    name: &'static str,
    value: &'static str
) -> impl Filter<Extract = (), Error = Rejection> + Copy

Create a Filter that requires a header to match the value exactly.

This Filter will look for a header with supplied name and the exact value, otherwise rejects the request.

Example

// Require `dnt: 1` header to be set.
let must_dnt = warp::header::exact("dnt", "1");