Skip to main content

ModifyResponseFn

Type Alias ModifyResponseFn 

Source
pub type ModifyResponseFn = Arc<dyn Fn(&str, &Authority, &mut ResponseMutation) + Send + Sync>;
Expand description

A function that mutates an incoming response’s status, headers, and/or body before the caller sees it, e.g. to redact sensitive fields.

Called with the request’s scheme and authority (i.e. where the response came from) and a ResponseMutation to mutate in place. See ModifyRequestFn for why it isn’t attached via a dedicated builder setter.

Attaching a ModifyResponseFn forces the entire response body to be buffered into memory and the response rebuilt, for every request the ACL is used with - there is no way to opt in per-request. See HttpAcl::has_modify_response.

Aliased Type§

pub struct ModifyResponseFn { /* private fields */ }