mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-30 23:09:44 +00:00
Simplify name_value
This commit is contained in:
parent
e9c6563367
commit
2c9240fd22
@ -170,14 +170,4 @@ def name_value(obj):
|
|||||||
"""
|
"""
|
||||||
Convert (key, value) pairs to HAR format.
|
Convert (key, value) pairs to HAR format.
|
||||||
"""
|
"""
|
||||||
|
return [{"name": k, "value": v} for k, v in obj.items()]
|
||||||
items = []
|
|
||||||
if hasattr(obj, 'fields'):
|
|
||||||
items = obj.fields
|
|
||||||
elif hasattr(obj, 'items'):
|
|
||||||
items = obj.items()
|
|
||||||
|
|
||||||
if items:
|
|
||||||
return [{"name": k, "value": v} for k, v in items]
|
|
||||||
else:
|
|
||||||
return ""
|
|
||||||
|
Loading…
Reference in New Issue
Block a user