Skip to content
Snippets Groups Projects
Unverified Commit d8df8e6c authored by David Robertson's avatar David Robertson Committed by GitHub
Browse files

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: default avatarBrendan Abolivier <babolivier@matrix.org>
parent c5815567
No related branches found
No related tags found
No related merge requests found
Fix a bug introduced in Synapse 0.33.3 causing requests to sometimes log strings such as `HTTPStatus.OK` instead of integer status codes.
\ No newline at end of file
...@@ -407,7 +407,10 @@ class SynapseRequest(Request): ...@@ -407,7 +407,10 @@ class SynapseRequest(Request):
user_agent = get_request_user_agent(self, "-") 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: if not self.finished:
# we didn't send the full response before we gave up (presumably because # we didn't send the full response before we gave up (presumably because
# the connection dropped) # the connection dropped)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment