fix(gateway): buffer admin pool batch update bodies

This commit is contained in:
MMEXA
2026-07-30 05:14:34 +08:00
parent a04673a90d
commit d8902ea612
3 changed files with 39 additions and 21 deletions
@@ -1,6 +1,8 @@
use http::Uri;
use super::{classify_control_route, headers};
use crate::control::GatewayPublicRequestContext;
use crate::handlers::shared::local_proxy_route_requires_buffered_body;
#[test]
fn classifies_admin_pool_overview_as_admin_proxy_route() {
@@ -92,6 +94,16 @@ fn classifies_admin_pool_provider_key_routes_as_admin_proxy_route() {
batch_update.route_kind.as_deref(),
Some("batch_update_keys")
);
let batch_update_context = GatewayPublicRequestContext::from_request_parts(
"trace-admin-pool-batch-update",
&http::Method::PATCH,
&batch_update_uri,
&headers,
Some(batch_update),
);
assert!(local_proxy_route_requires_buffered_body(
&batch_update_context
));
let resolve_selection_uri: Uri = "/api/admin/pool/provider-1/keys/resolve-selection"
.parse()