mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
Include boudary=...
in mutipart postData
While the HAR spec is not very explicit and their example shows just this one example: ```json "postData": { "mimeType": "multipart/form-data" } ``` Would it not make sense to include all the information necessary to parse out the post data `text`. Eg. ```json "postData": { "text": "--xYzZY\r\nContent-Disposition: form-data; name=\"sort1\"\r\n\r\noldest date first\r\n--xYzZY--\r\n", "mimeType": "multipart/form-data; boundary=xYzZY" }, ``` Currently, full mimeType is included only in `content-type` request header. Elsewhere in HAR spec they include the 'extras', eg ```json "content": { "mimeType": "text/html; charset=utf-8" } ``` So one could argue that `mimeType` should include all information necessary to interpret the data. In case of `multipart/form-data`, as per RFC2046 http://www.ietf.org/rfc/rfc2046.txt ``` The Content-Type field for multipart entities requires one parameter, "boundary". ``` I believe that earlier incarnations, eg `har_exporter.py` included it in the mimeType.
This commit is contained in:
parent
ea2d6474bf
commit
39d7ba852c
@ -140,7 +140,7 @@ def response(flow):
|
|||||||
for a, b in flow.request.urlencoded_form.items(multi=True)
|
for a, b in flow.request.urlencoded_form.items(multi=True)
|
||||||
]
|
]
|
||||||
entry["request"]["postData"] = {
|
entry["request"]["postData"] = {
|
||||||
"mimeType": flow.request.headers.get("Content-Type", "").split(";")[0],
|
"mimeType": flow.request.headers.get("Content-Type", ""),
|
||||||
"text": flow.request.get_text(strict=False),
|
"text": flow.request.get_text(strict=False),
|
||||||
"params": params
|
"params": params
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user