fix: preserve selected keys for quota refresh

This commit is contained in:
fawney19
2026-05-07 12:54:12 +08:00
parent a345bb8c0d
commit 64af7b1d8a
5 changed files with 194 additions and 4 deletions

View File

@@ -65,7 +65,7 @@ pub(super) async fn maybe_handle(
let normalized_provider_type = provider.provider_type.trim().to_ascii_lowercase();
let payload = if let Some(request_body) = request_body {
let payload = if let Some(request_body) = request_body.filter(|body| !body.is_empty()) {
match serde_json::from_slice::<AdminProviderQuotaRefreshRequest>(request_body) {
Ok(payload) => payload,
Err(_) => {

View File

@@ -220,6 +220,7 @@ pub(crate) fn admin_proxy_local_requires_buffered_body(
(Some("endpoints_manage"), http::Method::POST, Some("create_provider_key"))
| (Some("endpoints_manage"), http::Method::POST, Some("create_endpoint"))
| (Some("endpoints_manage"), http::Method::POST, Some("batch_delete_keys"))
| (Some("endpoints_manage"), http::Method::POST, Some("refresh_quota"))
| (Some("endpoints_manage"), http::Method::PUT, Some("update_key"))
| (Some("endpoints_manage"), http::Method::PUT, Some("update_endpoint"))
| (Some("modules_manage"), http::Method::PUT, Some("set_enabled"))