Add bad logic
This commit is contained in:
parent
e43e0ed5d5
commit
011976de89
@ -87,10 +87,18 @@ def get_body_from_form_data(
|
|||||||
data = None
|
data = None
|
||||||
headers: Dict[str, str] = {}
|
headers: Dict[str, str] = {}
|
||||||
|
|
||||||
# for part in parts:
|
for part in parts:
|
||||||
# for header in part.headers:
|
for header in part.headers:
|
||||||
# if header.key
|
if 'name="upload_file"' in header.value:
|
||||||
|
headers["key"] = "upload_file"
|
||||||
|
data = part.data
|
||||||
|
else:
|
||||||
|
if 'name="file"' in header.value:
|
||||||
|
data = part.data
|
||||||
|
else:
|
||||||
|
headers["file"] = part.data.decode("utf-8")
|
||||||
|
|
||||||
|
# name="x-amz-algorithm"', b'Content-Disposition':b'form-data; name="x-amz-credential"', b'Content-Disposition':b'form-data; name="x-amz-date"', b'Content-Disposition':b'form-data; name="policy"', b'Content-Disposition':b'form-data; name="x-amz-signature"', b'Content-Disposition':b'form-data; name="file"; filename="/run/user/1001/tmpi1gf2n_j/test_local_file.txt"'],
|
||||||
# for prt in parser.parts():
|
# for prt in parser.parts():
|
||||||
# if prt.name == "upload_file":
|
# if prt.name == "upload_file":
|
||||||
# headers["key"] = prt.name
|
# headers["key"] = prt.name
|
||||||
|
Loading…
Reference in New Issue
Block a user