From 39763527b0c343c5f373e4362fe68f354cb1f9d5 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Thu, 3 May 2018 16:59:16 +0100 Subject: [PATCH] size > upload_size as per spec feedback --- synapse/rest/media/v1/limits_resource.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/synapse/rest/media/v1/limits_resource.py b/synapse/rest/media/v1/limits_resource.py index d36b2430993c..7f936d150d8e 100644 --- a/synapse/rest/media/v1/limits_resource.py +++ b/synapse/rest/media/v1/limits_resource.py @@ -12,12 +12,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -import synapse.http.servlet - +# from twisted.web.server import NOT_DONE_YET from twisted.web.resource import Resource -from synapse.http.server import respond_with_json +from synapse.http.server import respond_with_json, respond_with_json_bytes class MediaLimitsResource(Resource): @@ -27,8 +25,12 @@ def __init__(self, hs): Resource.__init__(self) self.limits_dict = {} config = hs.get_config() - self.limits_dict["size"] = config.max_upload_size + self.limits_dict["upload_size"] = config.max_upload_size def render_GET(self, request): - respond_with_json(request, 200, self.limits_dict) + respond_with_json(request, 200, self.limits_dict, send_cors=True) + return NOT_DONE_YET + + def render_OPTIONS(self, request): + respond_with_json_bytes(request, 200, {}, send_cors=True) return NOT_DONE_YET