(&mut self, mut req: tonic::Request<()>)
| 94 | |
| 95 | impl tonic::service::Interceptor for CfInterceptor { |
| 96 | fn call(&mut self, mut req: tonic::Request<()>) -> Result<tonic::Request<()>, Status> { |
| 97 | req.metadata_mut().insert( |
| 98 | "cf-authorization", |
| 99 | self.token.parse().expect("invalid metadata value"), |
| 100 | ); |
| 101 | Ok(req) |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | /// Build an HTTPS client with mTLS. |