mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
feat: Enhance URL handling in CalibreOPDSClient to preserve catalog prefix for relative paths
This commit is contained in:
@@ -166,7 +166,12 @@ class CalibreOPDSClient:
|
||||
href = href.strip()
|
||||
if href.startswith("http://") or href.startswith("https://"):
|
||||
return href
|
||||
return urljoin(self._base_url, href)
|
||||
if href.startswith("/") or href.startswith("?") or href.startswith("#"):
|
||||
return urljoin(self._base_url, href)
|
||||
if href.startswith("./") or href.startswith("../"):
|
||||
return urljoin(self._base_url, href)
|
||||
# Ensure relative paths like "search" keep the catalog prefix
|
||||
return urljoin(self._base_url, f"./{href}")
|
||||
|
||||
def _open_client(self) -> httpx.Client:
|
||||
return httpx.Client(
|
||||
|
||||
Reference in New Issue
Block a user