@@ -144,7 +144,7 @@ macro_rules! builder_opts {
144144 ( $builder: ty, $url: expr, $options: expr) => { {
145145 let builder = $options. into_iter( ) . fold(
146146 <$builder>:: new( ) . with_url( $url. to_string( ) ) ,
147- |builder, ( key, value) | match key. as_ref( ) . parse( ) {
147+ |builder, ( key, value) | match key. as_ref( ) . to_ascii_lowercase ( ) . parse( ) {
148148 Ok ( k) => builder. with_config( k, value) ,
149149 Err ( _) => builder,
150150 } ,
@@ -177,9 +177,7 @@ pub fn parse_url(url: &Url) -> Result<(Box<dyn ObjectStore>, Path), super::Error
177177/// * `options`: A list of key-value pairs to pass to the [`ObjectStore`] builder.
178178/// Note different object stores accept different configuration options, so
179179/// the options that are read depends on the `url` value. One common pattern
180- /// is to pass configuration information via process variables using
181- /// [`std::env::vars`]. Keys must be lower-case and match the list of supported
182- /// keys to apply successfully.
180+ /// is to pass configuration information via process variables using [`std::env::vars`].
183181///
184182/// Returns
185183/// - An [`ObjectStore`] of the corresponding type
@@ -435,15 +433,19 @@ mod tests {
435433 server. push_fn ( |r| {
436434 assert_eq ! ( r. uri( ) . path( ) , "/foo/bar" ) ;
437435 assert_eq ! ( r. headers( ) . get( USER_AGENT ) . unwrap( ) , "test_url" ) ;
438- Response :: new ( String :: new ( ) )
436+ Response :: new ( String :: from ( "result" ) )
439437 } ) ;
440438
441439 let test = format ! ( "{}/foo/bar" , server. url( ) ) ;
442- let opts = [ ( "user_agent " , "test_url" ) , ( "allow_http" , "true" ) ] ;
440+ let opts = [ ( "USER_AGENT " , "test_url" ) , ( "allow_http" , "true" ) ] ;
443441 let url = test. parse ( ) . unwrap ( ) ;
444442 let ( store, path) = parse_url_opts ( & url, opts) . unwrap ( ) ;
445443 assert_eq ! ( path. as_ref( ) , "foo/bar" ) ;
446- store. get ( & path) . await . unwrap ( ) ;
444+
445+ let res = store. get ( & path) . await . unwrap ( ) ;
446+ let body = res. bytes ( ) . await . unwrap ( ) ;
447+ let body = str:: from_utf8 ( & body) . unwrap ( ) ;
448+ assert_eq ! ( body, "result" ) ;
447449
448450 server. shutdown ( ) . await ;
449451 }
0 commit comments