diff --git a/src/authentication/authentication_context.rs b/src/authentication/authentication_context.rs index eb90405..ac5e99c 100644 --- a/src/authentication/authentication_context.rs +++ b/src/authentication/authentication_context.rs @@ -100,7 +100,9 @@ where let decoded = general_purpose::STANDARD.decode(credentials)?; let utf8 = std::str::from_utf8(&decoded)?; let Some((user, pass)) = utf8.split_once(':') else { - return Err(AuthenticationError::ParseError("basic authorization formatted wrong".to_string())); + return Err(AuthenticationError::ParseError( + "basic authorization formatted wrong".to_string(), + )); }; self.validate_credentials(user, pass) diff --git a/src/authentication/authentication_service.rs b/src/authentication/authentication_service.rs index 9d04783..9d380ea 100644 --- a/src/authentication/authentication_service.rs +++ b/src/authentication/authentication_service.rs @@ -166,11 +166,9 @@ fn unauthorized_response( request: &HttpRequest, response_text: E, ) -> Result>, Error> { - let bearer_str = format!( - "Basic realm=\"Access to Baseboard Management Controller\"", - ); + let challenge = "Basic realm=\"Access to Baseboard Management Controller\""; let response = HttpResponse::Unauthorized() - .insert_header((header::WWW_AUTHENTICATE, bearer_str)) + .insert_header((header::WWW_AUTHENTICATE, challenge)) .body(response_text.to_string()); Ok(ServiceResponse::map_into_right_body(ServiceResponse::new( request.clone(),