diff options
author | Erik Johnston <erik@matrix.org> | 2020-07-03 19:02:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-03 19:02:19 +0100 |
commit | 5cdca53aa07f921029cb8027693095d150c37e32 (patch) | |
tree | d272c8d95776493ab7d4020a555293a510b2104e /synapse/rest/media/v1/config_resource.py | |
parent | Fix inconsistent handling of upper and lower cases of email addresses. (#7021) (diff) | |
download | synapse-5cdca53aa07f921029cb8027693095d150c37e32.tar.xz |
Merge different Resource implementation classes (#7732)
Diffstat (limited to 'synapse/rest/media/v1/config_resource.py')
-rw-r--r-- | synapse/rest/media/v1/config_resource.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/synapse/rest/media/v1/config_resource.py b/synapse/rest/media/v1/config_resource.py index 9f747de263..68dd2a1c8a 100644 --- a/synapse/rest/media/v1/config_resource.py +++ b/synapse/rest/media/v1/config_resource.py @@ -14,16 +14,10 @@ # limitations under the License. # -from twisted.web.server import NOT_DONE_YET +from synapse.http.server import DirectServeJsonResource, respond_with_json -from synapse.http.server import ( - DirectServeResource, - respond_with_json, - wrap_json_request_handler, -) - -class MediaConfigResource(DirectServeResource): +class MediaConfigResource(DirectServeJsonResource): isLeaf = True def __init__(self, hs): @@ -33,11 +27,9 @@ class MediaConfigResource(DirectServeResource): self.auth = hs.get_auth() self.limits_dict = {"m.upload.size": config.max_upload_size} - @wrap_json_request_handler async def _async_render_GET(self, request): await self.auth.get_user_by_req(request) respond_with_json(request, 200, self.limits_dict, send_cors=True) - def render_OPTIONS(self, request): + async def _async_render_OPTIONS(self, request): respond_with_json(request, 200, {}, send_cors=True) - return NOT_DONE_YET |