Implement custom scheme handling in _manual_redirect

Add custom scheme handling in manual redirect method.
This commit is contained in:
Kris Bogaerts 2026-01-03 15:30:52 +01:00 committed by GitHub
parent 59e3d9949f
commit 9f1194ac69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: