alamb commented on code in PR #5316:
URL: https://github.com/apache/arrow-rs/pull/5316#discussion_r1460354024
##########
object_store/src/parse.rs:
##########
@@ -305,4 +306,28 @@ mod tests {
let (_, path) = parse_url(&url).unwrap();
assert_eq!(path.as_ref(), "my file with spaces");
}
+
+ #[tokio::test]
+ #[cfg(feature = "http")]
+ async fn test_url_http() {
+ use crate::client::mock_server::MockServer;
+ use hyper::{header::USER_AGENT, Body, Response};
+
+ let server = MockServer::new();
+
+ server.push_fn(|r| {
+ assert_eq!(r.uri().path(), "/foo/bar");
+ assert_eq!(r.headers().get(USER_AGENT).unwrap(), "test_url");
+ Response::new(Body::empty())
+ });
+
+ let test = format!("{}/foo/bar", server.url());
Review Comment:
Can we also please document this test to explain the intent (which is that
some options are passed as http headers?)
Also, would it be possible to document the behavior on `parse_url_opts` --
it doesn't mention anything about this behavior in the documentation that I can
find:
https://docs.rs/object_store/latest/object_store/fn.parse_url_opts.html
--
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]