Skip to content

Commit b011eb8

Browse files
JordonPhillipsnateprewitt
authored andcommitted
Wrap HTTP payloads in async readables
1 parent 924e169 commit b011eb8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/smithy-http/src/smithy_http/serializers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
TimestampFormatTrait,
3333
)
3434
from smithy_core.types import PathPattern, TimestampFormat
35+
from smithy_core.aio.types import AsyncBytesReader
3536
from smithy_core.utils import serialize_float
3637

3738
from . import Field, tuples_to_fields
@@ -188,7 +189,7 @@ def begin_struct(self, schema: Schema) -> Iterator[ShapeSerializer]:
188189
),
189190
),
190191
fields=fields,
191-
body=payload,
192+
body=AsyncBytesReader(payload),
192193
)
193194

194195

@@ -363,7 +364,7 @@ def begin_struct(self, schema: Schema) -> Iterator[ShapeSerializer]:
363364

364365
self.result = _HTTPResponse(
365366
fields=tuples_to_fields(binding_serializer.header_serializer.headers),
366-
body=payload,
367+
body=AsyncBytesReader(payload),
367368
status=status,
368369
)
369370

0 commit comments

Comments
 (0)