From ae9be3f78cf036b0dc5142584279e81e80a9d082 Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Thu, 13 Aug 2026 17:09:21 +0500 Subject: [PATCH] Drop useless method checks in handlers. --- scrapy/extensions/remote_control.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scrapy/extensions/remote_control.py b/scrapy/extensions/remote_control.py index c3f3e0e72..31cbf7505 100644 --- a/scrapy/extensions/remote_control.py +++ b/scrapy/extensions/remote_control.py @@ -202,16 +202,12 @@ class RemoteControl: async def _handle_status(self, request: web.Request) -> web.Response: """An aiohttp request handler for the ``/status`` endpoint.""" - if request.method != "GET": - return web.json_response({"error": "method not allowed"}, status=405) if not self._is_authenticated(request): return web.json_response({"error": "unauthorized"}, status=401) return web.json_response(self._get_status()) async def _handle_execute(self, request: web.Request) -> web.Response: """An aiohttp request handler for the ``/execute`` endpoint.""" - if request.method != "POST": - return web.json_response({"error": "method not allowed"}, status=405) if not self._is_authenticated(request): return web.json_response({"error": "unauthorized"}, status=401)