summary refs log tree commit diff
path: root/synapse/rest/media/v1/thumbnail_resource.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-05-10 12:10:27 +0100
committerRichard van der Hoff <richard@matrix.org>2018-05-10 12:19:53 +0100
commit645cb4bf06deee1c4c10ecc3d7df2c914168f19a (patch)
treed7c6f45ee742673f80fd88af9e7eb5a4e6b46ec1 /synapse/rest/media/v1/thumbnail_resource.py
parentFactor wrap_request_handler_with_logging out of wrap_request_handler (diff)
downloadsynapse-645cb4bf06deee1c4c10ecc3d7df2c914168f19a.tar.xz
Remove redundant request_handler decorator
This is needless complexity; we might as well use the wrapper directly.

Also rename wrap_request_handler->wrap_json_request_handler.
Diffstat (limited to 'synapse/rest/media/v1/thumbnail_resource.py')
-rw-r--r--synapse/rest/media/v1/thumbnail_resource.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/synapse/rest/media/v1/thumbnail_resource.py b/synapse/rest/media/v1/thumbnail_resource.py
index 58ada49711..6c12d79f56 100644
--- a/synapse/rest/media/v1/thumbnail_resource.py
+++ b/synapse/rest/media/v1/thumbnail_resource.py
@@ -14,18 +14,21 @@
 # limitations under the License.
 
 
-from ._base import (
-    parse_media_id, respond_404, respond_with_file, FileInfo,
-    respond_with_responder,
-)
-from twisted.web.resource import Resource
-from synapse.http.servlet import parse_string, parse_integer
-from synapse.http.server import request_handler, set_cors_headers
+import logging
 
-from twisted.web.server import NOT_DONE_YET
 from twisted.internet import defer
+from twisted.web.resource import Resource
+from twisted.web.server import NOT_DONE_YET
 
-import logging
+from synapse.http.server import (
+    set_cors_headers,
+    wrap_json_request_handler,
+)
+from synapse.http.servlet import parse_integer, parse_string
+from ._base import (
+    FileInfo, parse_media_id, respond_404, respond_with_file,
+    respond_with_responder,
+)
 
 logger = logging.getLogger(__name__)
 
@@ -48,7 +51,7 @@ class ThumbnailResource(Resource):
         self._async_render_GET(request)
         return NOT_DONE_YET
 
-    @request_handler()
+    @wrap_json_request_handler
     @defer.inlineCallbacks
     def _async_render_GET(self, request):
         set_cors_headers(request)