parent
13c976de0d
commit
b84a821fd8
|
@ -18,6 +18,8 @@
|
|||
([#6543](https://github.com/mitmproxy/mitmproxy/pull/6543), @mhils)
|
||||
* DNS resolution is now exempted from `--ignore-hosts` in WireGuard Mode.
|
||||
([#6513](https://github.com/mitmproxy/mitmproxy/pull/6513), @dsphper)
|
||||
* Fix case sensitivity of URL added to blocklist
|
||||
([#6493](https://github.com/mitmproxy/mitmproxy/pull/6493), @emanuele-em)
|
||||
* Fix a bug where logging was stopped prematurely during shutdown.
|
||||
([#6541](https://github.com/mitmproxy/mitmproxy/pull/6541), @mhils)
|
||||
* For plaintext traffic, `--ignore-hosts` now also takes HTTP/1 host headers into account.
|
||||
|
|
|
@ -402,6 +402,7 @@ class FUrl(_Rex):
|
|||
code = "u"
|
||||
help = "URL"
|
||||
is_binary = False
|
||||
flags = re.IGNORECASE
|
||||
|
||||
# FUrl is special, because it can be "naked".
|
||||
|
||||
|
|
|
@ -22,20 +22,21 @@ def test_parse_spec_err(filter, err):
|
|||
|
||||
class TestBlockList:
|
||||
@pytest.mark.parametrize(
|
||||
"filter,status_code",
|
||||
"filter,request_url,status_code",
|
||||
[
|
||||
(":~u example.org:404", 404),
|
||||
(":~u example.com:404", None),
|
||||
("/!jpg/418", None),
|
||||
("/!png/418", 418),
|
||||
(":~u example.org:404", b"https://example.org/images/test.jpg", 404),
|
||||
(":~u example.com:404", b"https://example.org/images/test.jpg", None),
|
||||
(":~u test:404", b"https://example.org/images/TEST.jpg", 404),
|
||||
("/!jpg/418", b"https://example.org/images/test.jpg", None),
|
||||
("/!png/418", b"https://example.org/images/test.jpg", 418),
|
||||
],
|
||||
)
|
||||
def test_block(self, filter, status_code):
|
||||
def test_block(self, filter, request_url, status_code):
|
||||
bl = blocklist.BlockList()
|
||||
with taddons.context(bl) as tctx:
|
||||
tctx.configure(bl, block_list=[filter])
|
||||
f = tflow.tflow()
|
||||
f.request.url = b"https://example.org/images/test.jpg"
|
||||
f.request.url = request_url
|
||||
bl.request(f)
|
||||
if status_code is not None:
|
||||
assert f.response.status_code == status_code
|
||||
|
|
Loading…
Reference in New Issue