diff options
author | David Baker <dave@matrix.org> | 2015-04-01 15:13:14 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2015-04-01 15:13:14 +0100 |
commit | c5bf0343e8c9dc5a21a546bfc93f24f9fc4d9737 (patch) | |
tree | 71d789cdf7beac54da746d6d7fa44b8fcf2ef9a8 /synapse/http | |
parent | Completely replace fallback auth for C/S V2: (diff) | |
download | synapse-c5bf0343e8c9dc5a21a546bfc93f24f9fc4d9737.tar.xz |
Explain how I justified to myself making JsonResource not always send JSON.
Diffstat (limited to 'synapse/http')
-rw-r--r-- | synapse/http/server.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py index 76c561d105..0dbdce2839 100644 --- a/synapse/http/server.py +++ b/synapse/http/server.py @@ -79,6 +79,13 @@ class JsonResource(HttpServer, resource.Resource): Resources. Register callbacks via register_path() + + Callbacks can return a tuple of status code and a dict in which case the + the dict will automatically be sent to the client as a JSON object. + + The JsonResource is primarily intended for returning JSON, but callbacks + may send something other than JSON, they may do so by using the methods + on the request object and instead returning None. """ isLeaf = True |