wip/authorization-header #7

Merged
radical merged 8 commits from wip/authorization-header into main 2025-05-04 21:18:28 +00:00
Showing only changes of commit f12f81d584 - Show all commits

View file

@ -13,5 +13,11 @@ pub fn get_auth_header(headers: &HeaderMap) -> Result<&str, HttpResponse> {
return Err(HttpResponse::Unauthorized().json(format!(r#" {{ "error": "{}" }} "#, error)));
}
Ok(auth.unwrap())
let auth_value = auth.unwrap().split_whitespace().nth(1);
if let None = auth_value {
return Err(HttpResponse::BadRequest().finish());
}
Ok(auth_value.unwrap())
}