mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 07:08:10 +00:00
view: add id-based flow selection
This commit is contained in:
parent
94172594b3
commit
8866cc31bd
@ -9,6 +9,7 @@ The View:
|
|||||||
removed from the store.
|
removed from the store.
|
||||||
"""
|
"""
|
||||||
import collections
|
import collections
|
||||||
|
import re
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
import blinker
|
import blinker
|
||||||
@ -449,6 +450,9 @@ class View(collections.abc.Sequence):
|
|||||||
return [i for i in self._store.values() if i.marked]
|
return [i for i in self._store.values() if i.marked]
|
||||||
elif flow_spec == "@unmarked":
|
elif flow_spec == "@unmarked":
|
||||||
return [i for i in self._store.values() if not i.marked]
|
return [i for i in self._store.values() if not i.marked]
|
||||||
|
elif re.match(r"@[0-9a-f\-,]{36,}", flow_spec):
|
||||||
|
ids = flow_spec[1:].split(",")
|
||||||
|
return [i for i in self._store.values() if i.id in ids]
|
||||||
else:
|
else:
|
||||||
filt = flowfilter.parse(flow_spec)
|
filt = flowfilter.parse(flow_spec)
|
||||||
if not filt:
|
if not filt:
|
||||||
|
Loading…
Reference in New Issue
Block a user