Read the next body chunk. Returns `None` when the body is exhausted.
(&mut self)
| 94 | |
| 95 | /// Read the next body chunk. Returns `None` when the body is exhausted. |
| 96 | pub async fn next_chunk(&mut self) -> Result<Option<bytes::Bytes>, RouterError> { |
| 97 | match &mut self.body { |
| 98 | StreamingBody::Live(response) => response.chunk().await.map_err(|e| { |
| 99 | RouterError::UpstreamProtocol(format!("failed to read response chunk: {e}")) |
| 100 | }), |
| 101 | StreamingBody::Buffered(buf) => Ok(buf.take()), |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | fn sanitize_request_headers( |
no outgoing calls