mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-30 14:58:38 +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.
|
||||
"""
|
||||
|
||||
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 ""
|
||||
return [{"name": k, "value": v} for k, v in obj.items()]
|
||||
|
Loading…
Reference in New Issue
Block a user