We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 587d0a1 commit ed9a7f8Copy full SHA for ed9a7f8
packages/cubejs-backend-native/src/gateway/auth_middleware.rs
@@ -19,12 +19,20 @@ impl AuthExtension {
19
fn parse_token(header_value: &HeaderValue) -> Result<&str, HttpError> {
20
let trimmed = header_value.to_str()?.trim();
21
22
- if let Some(stripped) = trimmed.strip_prefix("Bearer ") {
23
- Ok(stripped)
+ let stripped = if let Some(stripped) = trimmed.strip_prefix("Bearer ") {
+ stripped
24
} else if let Some(stripped) = trimmed.strip_prefix("bearer ") {
25
26
+ } else {
27
+ trimmed
28
+ };
29
+
30
+ if stripped.is_empty() {
31
+ Err(HttpError::unauthorized(
32
+ "Value for authorization header cannot be empty".to_string(),
33
+ ))
34
} else {
- Ok(trimmed)
35
+ Ok(stripped)
36
}
37
38
0 commit comments