From 0cde7e3d08127e210e1b27dd1733b007cdca2e12 Mon Sep 17 00:00:00 2001 From: Sky O Date: Fri, 29 Mar 2024 15:56:09 +0000 Subject: [PATCH] Use header class --- moto/moto_proxy/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/moto/moto_proxy/utils.py b/moto/moto_proxy/utils.py index 71b873782..e40fdeff6 100644 --- a/moto/moto_proxy/utils.py +++ b/moto/moto_proxy/utils.py @@ -6,6 +6,10 @@ class Part: headers = [] data : bytes +class Header: + name : bytes + value : bytes + def get_body_from_form_data( body: bytes, boundary: str ) -> Tuple[Optional[bytes], Dict[str, str]]: @@ -38,7 +42,9 @@ def get_body_from_form_data( return def on_header_field(b,s,e): - current_part.headers.append({ name : b[s:e], value: ""}) + h = Header() + h.name = b[s:e] + current_part.headers.append(h) print("YO HEADER FIELD", ) return