(
&self,
request: CustomFetchRequest,
)
| 59 | } |
| 60 | |
| 61 | async fn fetch_stream( |
| 62 | &self, |
| 63 | request: CustomFetchRequest, |
| 64 | ) -> Result<CustomFetchStreamResponse, ProviderError> { |
| 65 | let response = self |
| 66 | .bridge |
| 67 | .fetch_proxy_stream(PluginFetchRequest { |
| 68 | url: request.url, |
| 69 | method: request.method, |
| 70 | headers: request.headers, |
| 71 | body: request.body, |
| 72 | }) |
| 73 | .await |
| 74 | .map_err(|e| ProviderError::NetworkError(e.to_string()))?; |
| 75 | |
| 76 | let stream = ReceiverStream::new(response.chunks) |
| 77 | .map(|item| item.map_err(|e| ProviderError::NetworkError(e.to_string()))); |
| 78 | Ok(CustomFetchStreamResponse { |
| 79 | status: response.status, |
| 80 | headers: response.headers, |
| 81 | stream: Box::pin(stream), |
| 82 | }) |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | pub(crate) fn sync_custom_fetch_proxy( |
nothing calls this directly
no test coverage detected