mirror of
https://github.com/taoky/shadowmire.git
synced 2025-07-08 17:32:43 +00:00
Fix urljoin usage in SyncPlainHTTP
This commit is contained in:
parent
b9c6ac5c62
commit
d565ac388b
@ -826,7 +826,7 @@ class SyncPlainHTTP(SyncBase):
|
|||||||
hrefs = get_existing_hrefs(package_simple_path)
|
hrefs = get_existing_hrefs(package_simple_path)
|
||||||
existing_hrefs = [] if hrefs is None else hrefs
|
existing_hrefs = [] if hrefs is None else hrefs
|
||||||
# Download JSON meta
|
# Download JSON meta
|
||||||
file_url = urljoin(self.upstream, f"/json/{package_name}")
|
file_url = urljoin(self.upstream, f"json/{package_name}")
|
||||||
success, resp = download(
|
success, resp = download(
|
||||||
self.session, file_url, self.jsonmeta_dir / (package_name + ".new")
|
self.session, file_url, self.jsonmeta_dir / (package_name + ".new")
|
||||||
)
|
)
|
||||||
@ -851,7 +851,7 @@ class SyncPlainHTTP(SyncBase):
|
|||||||
logger.info("removing file %s (if exists)", p)
|
logger.info("removing file %s (if exists)", p)
|
||||||
package_path = Path(normpath(package_simple_path / p))
|
package_path = Path(normpath(package_simple_path / p))
|
||||||
package_path.unlink(missing_ok=True)
|
package_path.unlink(missing_ok=True)
|
||||||
package_simple_url = urljoin(self.upstream, f"/simple/{package_name}/")
|
package_simple_url = urljoin(self.upstream, f"simple/{package_name}/")
|
||||||
for href in remote_hrefs:
|
for href in remote_hrefs:
|
||||||
url = urljoin(package_simple_url, href)
|
url = urljoin(package_simple_url, href)
|
||||||
dest = Path(normpath(package_simple_path / href))
|
dest = Path(normpath(package_simple_path / href))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user