Skip to content
Snippets Groups Projects
Unverified Commit 1821f7cc authored by Richard van der Hoff's avatar Richard van der Hoff Committed by GitHub
Browse files

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.
parent a5f7aff5
No related branches found
No related tags found
No related merge requests found
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
......
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