mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-17 17:54:20 -05:00
Fix buglet in DirectRenderJsonResource (#8897)
this was using `canonical_json` without setting it, so when you used it as a standalone class, you would get exceptions.
This commit is contained in:
parent
a5f7aff5e5
commit
1821f7cc26
1
changelog.d/8897.feature
Normal file
1
changelog.d/8897.feature
Normal file
@ -0,0 +1 @@
|
||||
Add support for allowing users to pick their own user ID during a single-sign-on login.
|
@ -275,6 +275,10 @@ class DirectServeJsonResource(_AsyncResource):
|
||||
formatting responses and errors as JSON.
|
||||
"""
|
||||
|
||||
def __init__(self, canonical_json=False, extract_context=False):
|
||||
super().__init__(extract_context)
|
||||
self.canonical_json = canonical_json
|
||||
|
||||
def _send_response(
|
||||
self, request: Request, code: int, response_object: Any,
|
||||
):
|
||||
@ -318,9 +322,7 @@ class JsonResource(DirectServeJsonResource):
|
||||
)
|
||||
|
||||
def __init__(self, hs, canonical_json=True, extract_context=False):
|
||||
super().__init__(extract_context)
|
||||
|
||||
self.canonical_json = canonical_json
|
||||
super().__init__(canonical_json, extract_context)
|
||||
self.clock = hs.get_clock()
|
||||
self.path_regexs = {}
|
||||
self.hs = hs
|
||||
|
Loading…
Reference in New Issue
Block a user