summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-01-26 12:47:34 +0000
committerGitHub <noreply@github.com>2022-01-26 12:47:34 +0000
commitd8df8e6c1432d25ea1c0310a5f2dc48d1688345f (patch)
tree43722b944a2ac3a5db89183cc8765495e302dd7e /synapse/http
parentAvoid type annotation problems in prom-client (#11834) (diff)
downloadsynapse-d8df8e6c1432d25ea1c0310a5f2dc48d1688345f.tar.xz
Don't print HTTPStatus.* in "Processed..." logs (#11827)
* Don't print HTTPStatus.* in "Processed..." logs

Fixes #11812. See also #7118 and
https://github.com/matrix-org/synapse/pull/7188#r401719326 in
particular.

Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/site.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/http/site.py b/synapse/http/site.py
index c180a1d323..40f6c04894 100644
--- a/synapse/http/site.py
+++ b/synapse/http/site.py
@@ -407,7 +407,10 @@ class SynapseRequest(Request):
 
         user_agent = get_request_user_agent(self, "-")
 
-        code = str(self.code)
+        # int(self.code) looks redundant, because self.code is already an int.
+        # But self.code might be an HTTPStatus (which inherits from int)---which has
+        # a different string representation. So ensure we really have an integer.
+        code = str(int(self.code))
         if not self.finished:
             # we didn't send the full response before we gave up (presumably because
             # the connection dropped)