Use header class

This commit is contained in:
Sky O 2024-03-29 15:56:09 +00:00
parent 7606a4fee2
commit 0cde7e3d08

View File

@ -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