criccomini commented on code in PR #743:
URL: 
https://github.com/apache/arrow-rs-object-store/pull/743#discussion_r3401123634


##########
src/aws/client.rs:
##########
@@ -1380,4 +1386,114 @@ mod tests {
             .unwrap();
         mock.shutdown().await;
     }
+
+    /// A marker inserted into response extensions by [`MarkerMiddleware`]
+    #[derive(Clone, Debug, PartialEq)]
+    struct Marker(usize);
+
+    /// [`HttpService`] middleware that tags every response with a [`Marker`]
+    ///
+    /// [`HttpService`]: crate::client::HttpService
+    #[derive(Debug)]
+    struct MarkerMiddleware(reqwest::Client);
+
+    #[async_trait]
+    impl crate::client::HttpService for MarkerMiddleware {
+        async fn call(
+            &self,
+            req: crate::client::HttpRequest,
+        ) -> Result<HttpResponse, HttpError> {
+            let mut response = crate::client::HttpService::call(&self.0, 
req).await?;
+            response.extensions_mut().insert(Marker(42));
+            Ok(response)
+        }
+    }
+
+    #[tokio::test]
+    async fn test_response_extensions_propagated() {

Review Comment:
   
[804ecf9](https://github.com/apache/arrow-rs-object-store/pull/743/commits/804ecf9acdef7d00a61d9dd575c67384b55ba4eb)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to