diff --git a/rust-runtime/smithy-http/src/middleware.rs b/rust-runtime/smithy-http/src/middleware.rs index 26f024654056e500bca247dbd393c6516858c28a..11d0a84ef4814d6952b462374e28c0b247db29f9 100644 --- a/rust-runtime/smithy-http/src/middleware.rs +++ b/rust-runtime/smithy-http/src/middleware.rs @@ -77,11 +77,10 @@ where O: ParseHttpResponse>, { if let Some(parsed_response) = handler.parse_unloaded(&mut response) { + trace!(response = ?response); return sdk_result(parsed_response, response); } - trace!(response = ?response); - let (parts, body) = response.into_parts(); let body = match read_body(body).await { Ok(body) => body, @@ -94,6 +93,7 @@ where }; let response = Response::from_parts(parts, Bytes::from(body)); + trace!(response = ?response); let parsed = handler.parse_loaded(&response); sdk_result(parsed, response.map(SdkBody::from)) }