mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 07:08:10 +00:00
Add font types to asset filter (~a) (#4928)
* Add font types to asset filter (~a) * Add PR number to changelog * remove flash mention * restore asset test Co-authored-by: Maximilian Hils <github@maximilianhils.com>
This commit is contained in:
parent
3847842f73
commit
1c93a93696
@ -15,6 +15,7 @@
|
||||
* Base container image bumped to Debian 11 Bullseye (@Kriechi)
|
||||
* Upstream replays don't do CONNECT on plaintext HTTP requests (#4876, @HoffmannP)
|
||||
* Remove workarounds for old pyOpenSSL versions (#4831, @KarlParkinson)
|
||||
* Add fonts to asset filter (~a) (#4928, @elespike)
|
||||
|
||||
## 28 September 2021: mitmproxy 7.0.4
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
application/javascript
|
||||
text/css
|
||||
image/*
|
||||
application/x-shockwave-flash
|
||||
font/*
|
||||
application/font-*
|
||||
~h rex Header line in either request or response
|
||||
~hq rex Header in request
|
||||
~hs rex Header in response
|
||||
@ -167,13 +168,15 @@ def _check_content_type(rex, message):
|
||||
|
||||
class FAsset(_Action):
|
||||
code = "a"
|
||||
help = "Match asset in response: CSS, JavaScript, images."
|
||||
help = "Match asset in response: CSS, JavaScript, images, fonts."
|
||||
ASSET_TYPES = [re.compile(x) for x in [
|
||||
b"text/javascript",
|
||||
b"application/x-javascript",
|
||||
b"application/javascript",
|
||||
b"text/css",
|
||||
b"image/.*"
|
||||
b"image/.*",
|
||||
b"font/.*",
|
||||
b"application/font-.*",
|
||||
]]
|
||||
|
||||
@only(http.HTTPFlow)
|
||||
|
@ -45,7 +45,9 @@ var ASSET_TYPES = [
|
||||
new RegExp("application/x-javascript"),
|
||||
new RegExp("application/javascript"),
|
||||
new RegExp("text/css"),
|
||||
new RegExp("image/.*")
|
||||
new RegExp("image/.*"),
|
||||
new RegExp("font/.*"),
|
||||
new RegExp("application/font.*"),
|
||||
];
|
||||
function assetFilter(flow) {
|
||||
if (flow.response) {
|
||||
|
Loading…
Reference in New Issue
Block a user