diff --git a/aws/rust-runtime/aws-inlineable/src/presigning.rs b/aws/rust-runtime/aws-inlineable/src/presigning.rs index b4569ce3407..a1c2594efc3 100644 --- a/aws/rust-runtime/aws-inlineable/src/presigning.rs +++ b/aws/rust-runtime/aws-inlineable/src/presigning.rs @@ -14,6 +14,7 @@ use aws_smithy_runtime_api::box_error::BoxError; use aws_smithy_runtime_api::client::orchestrator::HttpRequest; +use aws_smithy_types::body::SdkBody; use std::fmt; use std::time::{Duration, SystemTime}; @@ -175,10 +176,21 @@ impl PresigningConfigBuilder { #[non_exhaustive] pub struct PresignedRequest(HttpRequest); +impl Clone for PresignedRequest { + fn clone(&self) -> Self { + Self( + self.0 + .try_clone() + .expect("presigned requests do not have a body"), + ) + } +} + impl PresignedRequest { #[allow(dead_code)] pub(crate) fn new(inner: HttpRequest) -> Self { - Self(inner) + // throw out the body so we're sure it's cloneable + Self(inner.map(|_body| SdkBody::empty())) } /// Returns the HTTP request method.