diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-05-10 12:10:27 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-05-10 12:19:53 +0100 |
commit | 645cb4bf06deee1c4c10ecc3d7df2c914168f19a (patch) | |
tree | d7c6f45ee742673f80fd88af9e7eb5a4e6b46ec1 /synapse/rest/media/v1/download_resource.py | |
parent | Factor wrap_request_handler_with_logging out of wrap_request_handler (diff) | |
download | synapse-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/download_resource.py')
-rw-r--r-- | synapse/rest/media/v1/download_resource.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/synapse/rest/media/v1/download_resource.py b/synapse/rest/media/v1/download_resource.py index fe7e17596f..3fc3f64d62 100644 --- a/synapse/rest/media/v1/download_resource.py +++ b/synapse/rest/media/v1/download_resource.py @@ -12,16 +12,18 @@ # 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 +import logging -from ._base import parse_media_id, respond_404 +from twisted.internet import defer from twisted.web.resource import Resource -from synapse.http.server import request_handler, set_cors_headers - from twisted.web.server import NOT_DONE_YET -from twisted.internet import defer -import logging +from synapse.http.server import ( + set_cors_headers, + wrap_json_request_handler, +) +import synapse.http.servlet +from ._base import parse_media_id, respond_404 logger = logging.getLogger(__name__) @@ -43,7 +45,7 @@ class DownloadResource(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) |