From 857fa86e85313963edc6fc558044f3a3a2d792d5 Mon Sep 17 00:00:00 2001 From: benya Date: Sun, 8 Feb 2026 02:35:31 +0300 Subject: [PATCH] Fix NPMplus enable/disable request method --- services/npmplus.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/npmplus.py b/services/npmplus.py index fc94d98..a8feb75 100644 --- a/services/npmplus.py +++ b/services/npmplus.py @@ -34,11 +34,12 @@ def _request_json( headers: dict[str, str], data: dict[str, Any] | None, verify_tls: bool, + method: str | None = None, ) -> Any: body = None if data is not None: body = json.dumps(data).encode("utf-8") - req = Request(url, headers=headers, data=body) + req = Request(url, headers=headers, data=body, method=method) context = None if not verify_tls: @@ -186,7 +187,7 @@ def set_proxy_host(cfg: dict[str, Any], host_id: int, enabled: bool) -> tuple[bo "User-Agent": "tg-admin-bot", } try: - payload = _request_json(url, headers, None, verify_tls) + payload = _request_json(url, headers, None, verify_tls, method="POST") except Exception as e: return False, str(e) if payload is True or (isinstance(payload, dict) and payload.get("success", True)):