diff --git a/moto/moto_proxy/utils.py b/moto/moto_proxy/utils.py index bd1646506..23e98e27c 100644 --- a/moto/moto_proxy/utils.py +++ b/moto/moto_proxy/utils.py @@ -6,10 +6,16 @@ class Part: headers = [] data : bytes + def __repr__(self): + return f"Part(headers={repr(self.headers)}, data={self.data})" + class Header: name : bytes value : bytes + def __repr__(self): + return f"{self.name}:{self.value}" + def get_body_from_form_data( body: bytes, boundary: str ) -> Tuple[Optional[bytes], Dict[str, str]]: @@ -80,16 +86,21 @@ def get_body_from_form_data( print("YO PARTS", parts) data = None headers: Dict[str, str] = {} - for prt in parser.parts(): - if prt.name == "upload_file": - headers["key"] = prt.name - data = prt.file.read() - else: - val = prt.file.read() - if prt.name == "file": - data = val - else: - headers[prt.name] = val.decode("utf-8") + + # for part in parts: + # for header in part.headers: + # if header.key + + # for prt in parser.parts(): + # if prt.name == "upload_file": + # headers["key"] = prt.name + # data = prt.file.read() + # else: + # val = prt.file.read() + # if prt.name == "file": + # data = val + # else: + # headers[prt.name] = val.decode("utf-8") return data, headers # form_data file