summary refs log tree commit diff
path: root/docs/modules/spam_checker_callbacks.md
diff options
context:
space:
mode:
authorCharles Wright <cvwright@kombucha.systems>2021-09-17 12:04:37 -0500
committerGitHub <noreply@github.com>2021-09-17 18:04:37 +0100
commit6b6bb81b23425cf4f8e0c739946783b98ad056b8 (patch)
treef3765ea12a9b6195cf81e6b06f6115211bcd0d82 /docs/modules/spam_checker_callbacks.md
parentMerge branch 'release-v1.43' into develop (diff)
downloadsynapse-6b6bb81b23425cf4f8e0c739946783b98ad056b8.tar.xz
Fix #10837 by adding JSON encoding/decoding to the Module API example… (#10845)
Diffstat (limited to 'docs/modules/spam_checker_callbacks.md')
-rw-r--r--docs/modules/spam_checker_callbacks.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/modules/spam_checker_callbacks.md b/docs/modules/spam_checker_callbacks.md
index c45eafcc4b..81574a015c 100644
--- a/docs/modules/spam_checker_callbacks.md
+++ b/docs/modules/spam_checker_callbacks.md
@@ -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: