1
0
forked from nat/sludge

add logging, update readme

This commit is contained in:
gnat
2024-08-14 14:00:27 -07:00
parent 6175fafd20
commit bdc96b5700
10 changed files with 128 additions and 23 deletions

View File

@ -86,5 +86,10 @@ patchers: List[Patcher] = [
response.code,
response.headers,
uwuify(response.body).encode('utf-8')
) if 'text/html' in response.headers.values() and is_subdict({'uwu': 'true'}, request.path.params) else response
) if 'text/html' in response.headers.values() and is_subdict({'uwu': 'true'}, request.path.params) else response,
lambda response, request: Response(
response.code,
response.headers,
re.sub(r'sludge', lambda match: 'sludge' + ' (/&#x73;&#x6c;&#x28c;&#x64;&#x361;&#x292;/)' if random.randint(0, 5) < 1 else 'sludge', response.body.decode('utf-8')).encode('utf-8')
) if 'text/html' in response.headers.values() else response
]