pub fn generate_empty_204_response() -> Response {
    Response::from_status(StatusCode::NO_CONTENT)
        .with_header(
            header::CACHE_CONTROL,
            "no-cache, no-store, max-age=0, must-revalidate",
        )
        .with_header(header::ACCESS_CONTROL_ALLOW_ORIGIN, "*")
        .with_header(header::ACCESS_CONTROL_ALLOW_HEADERS, header::CONTENT_TYPE)
        .with_header(header::ACCESS_CONTROL_ALLOW_METHODS, "POST, OPTIONS")
        .with_header(header::CONNECTION, "keep-alive")
}
/// Utility to generate a synthetic `204 No Content` response.
///
/// Generates a response with a 204 status code, ensures the response is
/// non-cacheable via cache-control header directives and adds appropriate CORS
/// headers required for the beacon preflight request.
Utility to generate a synthetic `204 No Content` response.
Generates a response with a 204 status code, ensures the response is
non-cacheable via cache-control header directives and adds appropriate CORS
headers required for the beacon preflight request.
Utility to generate a synthetic ` 204 No Content ` response . Generates a response with a 204 status code ensures the response is non - cacheable via cache - control header directives and adds appropriate CORS headers required for the beacon preflight request .
pub fn generate_empty_204_response() -> Response {
    Response::from_status(StatusCode::NO_CONTENT)
        .with_header(
            header::CACHE_CONTROL,
            "no-cache, no-store, max-age=0, must-revalidate",
        )
        .with_header(header::ACCESS_CONTROL_ALLOW_ORIGIN, "*")
        .with_header(header::ACCESS_CONTROL_ALLOW_HEADERS, header::CONTENT_TYPE)
        .with_header(header::ACCESS_CONTROL_ALLOW_METHODS, "POST, OPTIONS")
        .with_header(header::CONNECTION, "keep-alive")
}
pub fn generate_empty_204_response ( ) -> Response { Response :: from_status ( StatusCode :: NO_CONTENT ) . with_header ( header :: CACHE_CONTROL , " " , ) . with_header ( header :: ACCESS_CONTROL_ALLOW_ORIGIN , " " ) . with_header ( header :: ACCESS_CONTROL_ALLOW_HEADERS , header :: CONTENT_TYPE ) . with_header ( header :: ACCESS_CONTROL_ALLOW_METHODS , " " ) . with_header ( header :: CONNECTION , " " ) }
Utility to generate a synthetic `204 No Content` response.
Utility to generate a synthetic ` 204 No Content ` response .