From 8dc2579ca36fa38ca3004c85e0a3b8f45e1d0ec9 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 18 Nov 2026 10:43:58 +0100 Subject: [PATCH 7/9] api: answer a body that cannot be read with 400 GENERIC_UNEXPECTED_REQUEST_ERROR has no HTTP status in the registry, so building the response for a failed body read panicked. --- common/taler-api/src/extract.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/taler-api/src/extract.rs b/common/taler-api/src/extract.rs index 5a6f22d..3bc2676 100644 --- a/common/taler-api/src/extract.rs +++ b/common/taler-api/src/extract.rs @@ -120,9 +120,12 @@ pub async fn decompressed_strict_body_limited( )); } Err(err) => { - return Err(failure( + // The registry gives this code no HTTP status, and building + // the response would panic. + return Err(failure_status( ErrorCode::GENERIC_UNEXPECTED_REQUEST_ERROR, format!("Failed to read body: {err}"), + StatusCode::BAD_REQUEST, )); } }, -- 2.47.3