mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
Refuse to replay a request with missing content.
This commit is contained in:
parent
b3901a7652
commit
0a90a3eaba
@ -1494,9 +1494,11 @@ class FlowMaster(controller.Master):
|
||||
"""
|
||||
Returns None if successful, or error message if not.
|
||||
"""
|
||||
#begin nocover
|
||||
if f.intercepting:
|
||||
return "Can't replay while intercepting..."
|
||||
if f.request.content == CONTENT_MISSING:
|
||||
return "Can't replay request with missing content..."
|
||||
#begin nocover
|
||||
if f.request:
|
||||
f.request._set_replay()
|
||||
if f.request.content:
|
||||
|
@ -516,6 +516,16 @@ class uFlowMaster(libpry.AutoTree):
|
||||
assert fm.load_script("nonexistent")
|
||||
assert "ValueError" in fm.load_script("scripts/starterr.py")
|
||||
|
||||
def test_replay(self):
|
||||
s = flow.State()
|
||||
fm = flow.FlowMaster(None, s)
|
||||
f = tutils.tflow_full()
|
||||
f.request.content = flow.CONTENT_MISSING
|
||||
assert "missing" in fm.replay_request(f)
|
||||
|
||||
f.intercepting = True
|
||||
assert "intercepting" in fm.replay_request(f)
|
||||
|
||||
def test_script_reqerr(self):
|
||||
s = flow.State()
|
||||
fm = flow.FlowMaster(None, s)
|
||||
|
Loading…
Reference in New Issue
Block a user