Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix buglet in DirectRenderJsonResource (#8897)
Browse files Browse the repository at this point in the history
this was using `canonical_json` without setting it, so when you used it as a
standalone class, you would get exceptions.
  • Loading branch information
richvdh authored Dec 10, 2020
1 parent a5f7aff commit 1821f7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/8897.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for allowing users to pick their own user ID during a single-sign-on login.
8 changes: 5 additions & 3 deletions synapse/http/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1821f7c

Please sign in to comment.