Harden admin and RPC security checks (#2773)

Signed-off-by: 安正超 <anzhengchao@gmail.com>
Co-authored-by: loverustfs <hello@rustfs.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
安正超
2026-05-03 19:55:09 +08:00
committed by GitHub
parent eb23710d2e
commit 66c38b629d
10 changed files with 490 additions and 64 deletions
+4 -4
View File
@@ -1143,7 +1143,7 @@ impl DiskAPI for RemoteDisk {
let mut headers = HeaderMap::new();
headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json"));
build_auth_headers(&url, &Method::GET, &mut headers);
build_auth_headers(&url, &Method::GET, &mut headers)?;
let mut reader = HttpReader::new_with_stall_timeout(
url,
@@ -1196,7 +1196,7 @@ impl DiskAPI for RemoteDisk {
let mut headers = HeaderMap::new();
headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json"));
build_auth_headers(&url, &Method::GET, &mut headers);
build_auth_headers(&url, &Method::GET, &mut headers)?;
Ok(Box::new(HttpReader::new(url, Method::GET, headers, None).await?))
}
@@ -1239,7 +1239,7 @@ impl DiskAPI for RemoteDisk {
let mut headers = HeaderMap::new();
headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json"));
build_auth_headers(&url, &Method::PUT, &mut headers);
build_auth_headers(&url, &Method::PUT, &mut headers)?;
Ok(Box::new(HttpWriter::new(url, Method::PUT, headers).await?))
}
@@ -1270,7 +1270,7 @@ impl DiskAPI for RemoteDisk {
let mut headers = HeaderMap::new();
headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json"));
build_auth_headers(&url, &Method::PUT, &mut headers);
build_auth_headers(&url, &Method::PUT, &mut headers)?;
Ok(Box::new(HttpWriter::new(url, Method::PUT, headers).await?))
}