mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-29 08:56:10 -05:00
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>
This commit is contained in:
parent
c5815567a4
commit
d8df8e6c14
1
changelog.d/11827.bugfix
Normal file
1
changelog.d/11827.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix a bug introduced in Synapse 0.33.3 causing requests to sometimes log strings such as `HTTPStatus.OK` instead of integer status codes.
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user