Skip to content

Commit f64a1ee

Browse files
committed
feat(spin_sdk/http): handle empty body in copy fn
Signed-off-by: Vaughn Dice <vdice@akamai.com>
1 parent 9c1ef0b commit f64a1ee

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/spin_sdk/http/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ async def send(request: Request) -> Response:
207207

208208
async def copy(bytes:bytes, tx:ByteStreamWriter):
209209
with tx:
210-
await tx.write_all(bytes)
210+
if bytes is not None:
211+
await tx.write_all(bytes)
211212

212213
def _trailers_future() -> FutureReader[Result[Optional[Fields], ErrorCode]]:
213214
return wit.result_option_wasi_http_types_0_3_0_rc_2026_03_15_fields_wasi_http_types_0_3_0_rc_2026_03_15_error_code_future(lambda: Ok(None))[1]

0 commit comments

Comments
 (0)