Open
Description
And the incoming value is not valid UTF-8. Indeed, consider:
@http(uri: "/http-payload-on-string", method: "POST")
operation HttpPayloadOnStringOperation {
input: HttpPayloadOnString
}
structure HttpPayloadOnString {
@httpPayload
message: String
}
We generate:
pub(crate) fn de_message_payload(
body: &[u8],
) -> std::result::Result<
::std::option::Option<::std::string::String>,
::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
> {
(!body.is_empty())
.then(|| {
let body_str = std::str::from_utf8(body)?;
Ok(body_str.to_string())
})
.transpose()
}
What RequestRejection
do we yield? We're leveraging this #[from]
conversion when using ?
above:
Thus returning an incorrect rejection. We're not percent-decoding a URI here!