@@ -43,7 +43,7 @@ impl Authorizer for SignatureValidatingAuthorizer {
4343 & self , headers_map : & HashMap < String , String > ,
4444 ) -> Result < AuthResponse , VssError > {
4545 let auth_header = headers_map
46- . get ( "Authorization " )
46+ . get ( "authorization " )
4747 . ok_or_else ( || VssError :: AuthError ( "Authorization header not found." . to_string ( ) ) ) ?;
4848
4949 if auth_header. len ( ) <= ( 33 + 64 ) * 2 {
@@ -122,17 +122,17 @@ mod tests {
122122
123123 // Test a valid signature
124124 let ( token, pubkey) = build_token ( now) ;
125- headers_map. insert ( "Authorization " . to_string ( ) , token) ;
125+ headers_map. insert ( "authorization " . to_string ( ) , token) ;
126126 assert_eq ! ( auth. verify( & headers_map) . await . unwrap( ) . user_token, format!( "{pubkey:x}" ) ) ;
127127
128128 // Test a signature too far in the future
129129 let ( token, _) = build_token ( now + 60 * 60 * 24 + 10 ) ;
130- headers_map. insert ( "Authorization " . to_string ( ) , token) ;
130+ headers_map. insert ( "authorization " . to_string ( ) , token) ;
131131 assert ! ( matches!( auth. verify( & headers_map) . await . unwrap_err( ) , VssError :: AuthError ( _) ) ) ;
132132
133133 // Test a signature too far in the past
134134 let ( token, _) = build_token ( now - 60 * 60 * 24 - 10 ) ;
135- headers_map. insert ( "Authorization " . to_string ( ) , token) ;
135+ headers_map. insert ( "authorization " . to_string ( ) , token) ;
136136 assert ! ( matches!( auth. verify( & headers_map) . await . unwrap_err( ) , VssError :: AuthError ( _) ) ) ;
137137
138138 // Test a token with an invalid signature
@@ -142,7 +142,7 @@ mod tests {
142142 . enumerate ( )
143143 . map ( |( idx, c) | if ( 33 * 2 + 10 ..33 * 2 + 15 ) . contains ( & idx) { '0' } else { c } )
144144 . collect ( ) ;
145- headers_map. insert ( "Authorization " . to_string ( ) , token) ;
145+ headers_map. insert ( "authorization " . to_string ( ) , token) ;
146146 assert ! ( matches!( auth. verify( & headers_map) . await . unwrap_err( ) , VssError :: AuthError ( _) ) ) ;
147147
148148 // Test a token with the wrong public key
@@ -152,7 +152,7 @@ mod tests {
152152 . enumerate ( )
153153 . map ( |( idx, c) | if ( 10 ..15 ) . contains ( & idx) { '0' } else { c } )
154154 . collect ( ) ;
155- headers_map. insert ( "Authorization " . to_string ( ) , token) ;
155+ headers_map. insert ( "authorization " . to_string ( ) , token) ;
156156 assert ! ( matches!( auth. verify( & headers_map) . await . unwrap_err( ) , VssError :: AuthError ( _) ) ) ;
157157 }
158158}
0 commit comments