From cc31e88c91e4704eb683a0a441ffe172b89f1e96 Mon Sep 17 00:00:00 2001 From: GatewayJ <835269233@qq.com> Date: Sat, 20 Dec 2025 20:25:52 +0800 Subject: [PATCH] fix: expiration time (#1215) --- crates/policy/src/auth/credentials.rs | 3 +-- rustfs/src/admin/router.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/policy/src/auth/credentials.rs b/crates/policy/src/auth/credentials.rs index 4cbe8707..9813f6c4 100644 --- a/crates/policy/src/auth/credentials.rs +++ b/crates/policy/src/auth/credentials.rs @@ -20,7 +20,6 @@ use serde::{Deserialize, Serialize}; use serde_json::{Value, json}; use std::collections::HashMap; use time::OffsetDateTime; -use time::macros::offset; use tracing::warn; const ACCESS_KEY_MIN_LEN: usize = 3; @@ -231,7 +230,7 @@ pub fn create_new_credentials_with_metadata( let expiration = { if let Some(v) = claims.get("exp") { if let Some(expiry) = v.as_i64() { - Some(OffsetDateTime::from_unix_timestamp(expiry)?.to_offset(offset!(+8))) + Some(OffsetDateTime::from_unix_timestamp(expiry)?) } else { None } diff --git a/rustfs/src/admin/router.rs b/rustfs/src/admin/router.rs index a28bf29e..fd3c3306 100644 --- a/rustfs/src/admin/router.rs +++ b/rustfs/src/admin/router.rs @@ -101,7 +101,7 @@ where && headers .get(header::CONTENT_TYPE) .and_then(|v| v.to_str().ok()) - .map(|ct| ct.split(';').next().unwrap_or("").trim()) + .map(|ct| ct.split(';').next().unwrap_or("").trim().to_lowercase()) .map(|ct| ct == "application/x-www-form-urlencoded") .unwrap_or(false) {