From f5f3c454945e9d7d2f29105346cf7ee80f082a18 Mon Sep 17 00:00:00 2001 From: Kay Faraday Date: Wed, 8 Sep 2021 03:44:01 +0000 Subject: [PATCH] fix regressions in last two commits lol too lazy to rebase --- app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 4ef3ae0..a9b34d9 100755 --- a/app.py +++ b/app.py @@ -26,7 +26,7 @@ def load_config(): host['pattern'] = re.compile(host['pattern'].encode()) host['repl_decoded'] = host['repl'] host['repl'] = host['repl'].encode() - host['mime_types'] = frozenset(host.get('excluded_routes', ())) + host['mime_types'] = frozenset(host.get('mime_types', ())) host['excluded_routes'].sort(key=len, reverse=True) return config @@ -65,6 +65,7 @@ async def handler(request): print('Not configured to replace for MIME type', upstream_resp.content_type) return await proxy_passthrough(upstream_resp, resp) + print('replacing', repr(hconfig['pattern_decoded']), 'with', repr(hconfig['repl_decoded'])) return await proxy_replace(hconfig, upstream_resp, resp) async def proxy_replace(hconfig, upstream_resp, resp):