From 9f1194ac6956dee7c949326d5bf3ad83e0f78d00 Mon Sep 17 00:00:00 2001 From: Kris Bogaerts Date: Sat, 3 Jan 2026 15:30:52 +0100 Subject: [PATCH] Implement custom scheme handling in _manual_redirect Add custom scheme handling in manual redirect method. --- pyhon/connection/auth.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyhon/connection/auth.py b/pyhon/connection/auth.py index 3ab491c..5ed6e1e 100644 --- a/pyhon/connection/auth.py +++ b/pyhon/connection/auth.py @@ -133,6 +133,10 @@ class HonAuth: return login_url[0] async def _manual_redirect(self, url: str) -> str: + # Add custom scheme handling before the GET request + if any(url.startswith(s) for s in ['hon://', 'candy://', 'hoover://', 'rosieres://']): + return url + async with self._request.get(url, allow_redirects=False) as response: new_location = response.headers.get("Location", "") if not new_location: