summary refs log tree commit diff
diff options
context:
space:
mode:
authorWill Hunt <will@half-shot.uk>2018-07-27 12:17:40 +0100
committerWill Hunt <will@half-shot.uk>2018-07-27 12:17:40 +0100
commitbf30fd834229cebb547c7b09510b8990b638afea (patch)
tree418c0bd2d67ecd59b831b5e54eef7eb4cee6d852
parentlinting (diff)
downloadsynapse-bf30fd834229cebb547c7b09510b8990b638afea.tar.xz
Auth media/r0/config
-rw-r--r--synapse/rest/media/v1/config_resource.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/rest/media/v1/config_resource.py b/synapse/rest/media/v1/config_resource.py

index b1018e7067..44d3d567aa 100644 --- a/synapse/rest/media/v1/config_resource.py +++ b/synapse/rest/media/v1/config_resource.py
@@ -14,6 +14,7 @@ # limitations under the License. # +from twisted.internet import defer from twisted.web.resource import Resource from twisted.web.server import NOT_DONE_YET from synapse.http.server import respond_with_json, wrap_json_request_handler @@ -26,6 +27,7 @@ class MediaConfigResource(Resource): Resource.__init__(self) config = hs.get_config() self.clock = hs.get_clock() + self.auth = hs.get_auth() self.limits_dict = { "m.upload.size": config.max_upload_size, } @@ -35,8 +37,10 @@ class MediaConfigResource(Resource): return NOT_DONE_YET @wrap_json_request_handler + @defer.inlineCallbacks def _async_render_GET(self, request): - return respond_with_json(request, 200, self.limits_dict) + yield self.auth.get_user_by_req(request) + respond_with_json(request, 200, self.limits_dict) def render_OPTIONS(self, request): respond_with_json(request, 200, {}, send_cors=True)