pub trait RequestHandler: Send + Sync {
// Required methods
fn handle_request(&self, req: &mut Request<BoxBody>);
fn handle_response(&self, res: &mut Response<BoxBody>);
}Expand description
Trait for intercepting and modifying HTTP requests and responses.
Required Methods§
Sourcefn handle_request(&self, req: &mut Request<BoxBody>)
fn handle_request(&self, req: &mut Request<BoxBody>)
Called before forwarding the request to upstream. Modify the request in place to alter what gets sent.
Sourcefn handle_response(&self, res: &mut Response<BoxBody>)
fn handle_response(&self, res: &mut Response<BoxBody>)
Called before sending the response back to the client. Modify the response in place to alter what the client receives.