From b7918c2cc5679f9a9ddfc10a9e309a7a21b1b4c4 Mon Sep 17 00:00:00 2001 From: Sky O Date: Thu, 28 Mar 2024 19:58:46 +0000 Subject: [PATCH] Don't convert to stream for no reason --- moto/moto_proxy/utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/moto/moto_proxy/utils.py b/moto/moto_proxy/utils.py index bcd7fe299..9a9669ac5 100644 --- a/moto/moto_proxy/utils.py +++ b/moto/moto_proxy/utils.py @@ -1,4 +1,3 @@ -import io from typing import Dict, Optional, Tuple import multipart @@ -7,9 +6,8 @@ import multipart def get_body_from_form_data( body: bytes, boundary: str ) -> Tuple[Optional[bytes], Dict[str, str]]: - body_stream = io.BytesIO(body) parser = multipart.MultipartParser(boundary=boundary) - parser.write(body_stream) + parser.write(body) data = None headers: Dict[str, str] = {} for prt in parser.parts():