16 lines
333 B
Rust
16 lines
333 B
Rust
use std::collections::HashMap;
|
|
|
|
use crate::client::{RequestInfo, Response};
|
|
|
|
pub enum InterceptAction {
|
|
Continue,
|
|
Block,
|
|
Fulfill(Response),
|
|
ModifyHeaders(HashMap<String, String>),
|
|
}
|
|
|
|
#[async_trait::async_trait]
|
|
pub trait RequestInterceptor {
|
|
async fn intercept(&self, request: &RequestInfo) -> InterceptAction;
|
|
}
|