Skip to content

Commit

Permalink
Fix "bearer" unstriped in authorization header
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtaruhi committed Apr 19, 2024
1 parent 64af5d4 commit 297a597
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ where
) -> AuthResult<Token<Claims>> {
match header_map.get(AUTHORIZATION).map(HeaderValue::to_str) {
Some(Ok(header_value)) => {
let token_value = if header_value.strip_prefix("Bearer").is_some() {
header_value.trim()
let token_value = if let Some(token_value) = header_value.strip_prefix("Bearer") {
token_value.trim()
} else {
// to-do: better error handling
return Err(AuthError::NoToken);
Expand Down

0 comments on commit 297a597

Please sign in to comment.