Skip to main content

cors_headers

Function cors_headers 

Source
pub fn cors_headers(
    policy: &CorsPolicy,
    request_origin: Option<&str>,
) -> Headers
Expand description

Build the CORS response headers for a request.

The map is empty when the origin is not allowed, which leaves the response without any cross-origin permission — exactly what a browser needs to refuse it.