You've already forked AstralRinth
forked from didirus/AstralRinth
Fix clippy
This commit is contained in:
@@ -880,11 +880,11 @@ pub async fn active_servers(
|
|||||||
) -> Result<HttpResponse, ApiError> {
|
) -> Result<HttpResponse, ApiError> {
|
||||||
let master_key = dotenvy::var("PYRO_API_KEY")?;
|
let master_key = dotenvy::var("PYRO_API_KEY")?;
|
||||||
|
|
||||||
if !req
|
if req
|
||||||
.head()
|
.head()
|
||||||
.headers()
|
.headers()
|
||||||
.get("X-Master-Key")
|
.get("X-Master-Key")
|
||||||
.is_some_and(|it| it.as_bytes() == master_key.as_bytes())
|
.is_none_or(|it| it.as_bytes() != master_key.as_bytes())
|
||||||
{
|
{
|
||||||
return Err(ApiError::CustomAuthentication(
|
return Err(ApiError::CustomAuthentication(
|
||||||
"Invalid master key".to_string(),
|
"Invalid master key".to_string(),
|
||||||
|
|||||||
Reference in New Issue
Block a user