fix regressions in last two commits
lol too lazy to rebase
This commit is contained in:
parent
72de283a8d
commit
f5f3c45494
3
app.py
3
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):
|
||||
|
|
Loading…
Reference in New Issue