mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
fix default argument
Python evaluates default args during method definition. So you get the same dict each time you call this method. Therefore the dict is the SAME actual object each time.
This commit is contained in:
parent
5288aa3640
commit
754f929187
@ -245,8 +245,12 @@ class SettingsFrame(Frame):
|
|||||||
SETTINGS_MAX_HEADER_LIST_SIZE=0x6,
|
SETTINGS_MAX_HEADER_LIST_SIZE=0x6,
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, length=0, flags=Frame.FLAG_NO_FLAGS, stream_id=0x0, settings={}):
|
def __init__(self, length=0, flags=Frame.FLAG_NO_FLAGS, stream_id=0x0, settings=None):
|
||||||
super(SettingsFrame, self).__init__(length, flags, stream_id)
|
super(SettingsFrame, self).__init__(length, flags, stream_id)
|
||||||
|
|
||||||
|
if settings is None:
|
||||||
|
settings = {}
|
||||||
|
|
||||||
self.settings = settings
|
self.settings = settings
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user