From aa06bf0cc837d82c552ae50f59d313127f9b79d9 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 11 Jun 2019 22:23:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20Fixes=20remove=20url=20API=20cal?= =?UTF-8?q?l=20in=20AdGuard=200.96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Franck Nijhof --- adguardhome/filtering.py | 2 +- tests/test_filtering.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/adguardhome/filtering.py b/adguardhome/filtering.py index b3a6de86..c363e0ab 100644 --- a/adguardhome/filtering.py +++ b/adguardhome/filtering.py @@ -56,7 +56,7 @@ async def add_url(self, name: str, url: str) -> bool: async def remove_url(self, url: str) -> bool: """Remove a new filter subscription from AdGuard Home.""" response = await self._adguard._request( - "filtering/remove_url", method="POST", data="url={}".format(url) + "filtering/remove_url", method="POST", json_data={"url": url} ) if response.rstrip() != "OK": raise AdGuardHomeError( diff --git a/tests/test_filtering.py b/tests/test_filtering.py index 6f453aa9..81e3c4de 100644 --- a/tests/test_filtering.py +++ b/tests/test_filtering.py @@ -149,8 +149,8 @@ async def test_remove_url(event_loop, aresponses): """Test remove filter subscription from AdGuard Home filtering.""" # Handle to run asserts on request in async def response_handler(request): - data = await request.text() - assert data == "url=https://example.com/1.txt" + data = await request.json() + assert data == {"url": "https://example.com/1.txt"} return aresponses.Response(status=200, text="OK") aresponses.add(