aboutsummaryrefslogtreecommitdiff
path: root/http2irc.py
diff options
context:
space:
mode:
authorGravatar JustAnotherArchivist2021-12-07 06:01:19 +0000
committerGravatar JustAnotherArchivist2021-12-07 06:01:19 +0000
commit33dfff166c06a7980dec7994dbe8b22998e6cbf6 (patch)
tree406e2cf414a312198734f2b924a440e6c4585164 /http2irc.py
parentFix crash on attempting to send to an unjoined channel (diff)
signature
Let modules suppress messages by returning None
Diffstat (limited to 'http2irc.py')
-rw-r--r--http2irc.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/http2irc.py b/http2irc.py
index 79bdd58..0d2e190 100644
--- a/http2irc.py
+++ b/http2irc.py
@@ -1029,6 +1029,9 @@ class WebServer:
except Exception as e:
self.logger.error(f'Bad request {id(request)}: exception in module process function: {type(e).__module__}.{type(e).__name__}: {e!s}')
raise aiohttp.web.HTTPBadRequest()
+ if message is None:
+ self.logger.info(f'Accepted request {id(request)}, module returned None')
+ raise aiohttp.web.HTTPOk()
if '\r' in message or '\n' in message:
self.logger.error(f'Bad request {id(request)}: module process function returned message with linebreaks: {message!r}')
raise aiohttp.web.HTTPBadRequest()