Don't convert to stream for no reason
This commit is contained in:
parent
8eaa8788b9
commit
b7918c2cc5
@ -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():
|
||||
|
Loading…
Reference in New Issue
Block a user