From f927ae6e15431e543c4d31af29da2d72172cd506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arpad=20M=C3=BCller?= Date: Fri, 21 Feb 2025 12:01:57 +0100 Subject: [PATCH] Return a json response in scheduling_policy handler (#10904) Return an empty json response in the `scheduling_policy` handler. This prevents errors of the form: ``` Error: receive body: error decoding response body: EOF while parsing a value at line 1 column 0 ``` when setting the scheduling policy via the `storcon_cli`. part of #9011. --- storage_controller/src/http.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/storage_controller/src/http.rs b/storage_controller/src/http.rs index 1cc61a12e8..fb7b4356d1 100644 --- a/storage_controller/src/http.rs +++ b/storage_controller/src/http.rs @@ -1354,10 +1354,7 @@ async fn handle_safekeeper_scheduling_policy( .set_safekeeper_scheduling_policy(id, body.scheduling_policy) .await?; - Ok(Response::builder() - .status(StatusCode::NO_CONTENT) - .body(Body::empty()) - .unwrap()) + json_response(StatusCode::OK, ()) } /// Common wrapper for request handlers that call into Service and will operate on tenants: they must only