mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-31 23:38:46 +00:00
Fix generated values in request path specification.
This commit is contained in:
parent
0c9cfb3f38
commit
8c6cc8140c
@ -136,7 +136,7 @@ v_literal = pp.MatchFirst(
|
||||
v_naked_literal = pp.MatchFirst(
|
||||
[
|
||||
v_literal,
|
||||
pp.Word("".join(i for i in pp.printables if i not in ",:\n"))
|
||||
pp.Word("".join(i for i in pp.printables if i not in ",:\n@\'\""))
|
||||
]
|
||||
)
|
||||
|
||||
@ -479,7 +479,7 @@ class Path(_Component):
|
||||
|
||||
@classmethod
|
||||
def expr(klass):
|
||||
e = NakedValue.copy()
|
||||
e = Value | NakedValue
|
||||
return e.setParseAction(lambda x: klass(*x))
|
||||
|
||||
def values(self, settings):
|
||||
|
@ -169,6 +169,7 @@ class TestMisc:
|
||||
v2 = v.freeze({})
|
||||
v3 = v2.freeze({})
|
||||
assert v2.value.val == v3.value.val
|
||||
assert len(v2.value.val) == 100
|
||||
|
||||
s = v.spec()
|
||||
assert s == v.expr().parseString(s)[0].spec()
|
||||
@ -488,6 +489,10 @@ class TestRequest:
|
||||
r = language.parse_request({}, "GET:/:b@100").freeze({})
|
||||
assert len(r.spec()) > 100
|
||||
|
||||
def test_path_generator(self):
|
||||
r = language.parse_request({}, "GET:@100").freeze({})
|
||||
assert len(r.spec()) > 100
|
||||
|
||||
|
||||
class TestWriteValues:
|
||||
def test_send_chunk(self):
|
||||
|
Loading…
Reference in New Issue
Block a user