mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 16:33:53 +01:00
This commit is contained in:
parent
b4c1af8cea
commit
6b6bb81b23
2 changed files with 3 additions and 2 deletions
1
changelog.d/10845.doc
Normal file
1
changelog.d/10845.doc
Normal file
|
@ -0,0 +1 @@
|
|||
Fix some crashes in the Module API example code, by adding JSON encoding/decoding.
|
|
@ -136,9 +136,9 @@ class IsUserEvilResource(Resource):
|
|||
self.evil_users = config.get("evil_users") or []
|
||||
|
||||
def render_GET(self, request: Request):
|
||||
user = request.args.get(b"user")[0]
|
||||
user = request.args.get(b"user")[0].decode()
|
||||
request.setHeader(b"Content-Type", b"application/json")
|
||||
return json.dumps({"evil": user in self.evil_users})
|
||||
return json.dumps({"evil": user in self.evil_users}).encode()
|
||||
|
||||
|
||||
class ListSpamChecker:
|
||||
|
|
Loading…
Reference in a new issue