summary refs log tree commit diff
path: root/synapse/rest/media/v1/limits_resource.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/rest/media/v1/limits_resource.py')
-rw-r--r--synapse/rest/media/v1/limits_resource.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/synapse/rest/media/v1/limits_resource.py b/synapse/rest/media/v1/limits_resource.py
index d36b243099..7f936d150d 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 @@ class MediaLimitsResource(Resource):
         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