(req: Request, state: &S)
| 26 | type Rejection = axum::response::Response; |
| 27 | |
| 28 | async fn from_request(req: Request, state: &S) -> Result<Self, Self::Rejection> { |
| 29 | let bytes = Bytes::from_request(req, state) |
| 30 | .await |
| 31 | .map_err(IntoResponse::into_response)?; |
| 32 | |
| 33 | let string = bytes |
| 34 | .try_into() |
| 35 | .map_err(|_| (StatusCode::BAD_REQUEST, "Request body didn't contain valid UTF-8").into_response())?; |
| 36 | |
| 37 | Ok(ByteStringBody(string)) |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | pub struct XForwardedFor(pub IpAddr); |
nothing calls this directly
no test coverage detected