mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Fix parsing "host" and "post" in "attach" request.
This commit is contained in:
parent
c5feeea05b
commit
9f37496b4c
1 changed files with 4 additions and 1 deletions
|
|
@ -357,7 +357,8 @@ class MessageDict(collections.OrderedDict):
|
|||
|
||||
If validate=False, it's treated as if it were (lambda x: x) - i.e. any value
|
||||
is considered valid, and is returned unchanged. If validate is a type or a
|
||||
tuple, it's treated as if it were json.of_type(validate).
|
||||
tuple, it's treated as json.of_type(validate). Otherwise, if validate is not
|
||||
callable(), it's treated as json.default(validate).
|
||||
|
||||
If validate() returns successfully, the item is substituted with the value
|
||||
it returns - thus, the validator can e.g. replace () with a suitable default
|
||||
|
|
@ -373,6 +374,8 @@ class MessageDict(collections.OrderedDict):
|
|||
validate = lambda x: x
|
||||
elif isinstance(validate, type) or isinstance(validate, tuple):
|
||||
validate = json.of_type(validate)
|
||||
elif not callable(validate):
|
||||
validate = json.default(validate)
|
||||
|
||||
value = self.get(key, ())
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue