diff --git a/basic/src/helper/bios_ctx_helper.rs b/basic/src/helper/bios_ctx_helper.rs index 32f40e5b4..1d2631a1a 100644 --- a/basic/src/helper/bios_ctx_helper.rs +++ b/basic/src/helper/bios_ctx_helper.rs @@ -15,10 +15,14 @@ where let bios_ctx = if let Some(bios_ctx) = request.header(&funs.rbum_head_key_bios_ctx()).or_else(|| request.header(&funs.rbum_head_key_bios_ctx().to_lowercase())) { TardisFuns::json.str_to_obj::(&TardisFuns::crypto.base64.decode_to_string(bios_ctx)?)? } else { - return Err(TardisError::unauthorized( - &format!("[Basic] Request is not legal, missing header [{}]", funs.rbum_head_key_bios_ctx()), - "401-auth-req-ak-not-exist", - )); + if ctx.owner.is_empty() && ctx.ak.is_empty() && ctx.own_paths.is_empty() && ctx.roles.is_empty() && ctx.groups.is_empty() { + return Err(TardisError::unauthorized( + &format!("[Basic] Request is not legal, missing header [{}]", funs.rbum_head_key_bios_ctx()), + "401-auth-req-ak-not-exist", + )); + } else { + return Ok(()); + } }; if bios_ctx.own_paths.contains(&ctx.own_paths) {