Skip to content

Commit f22d3c9

Browse files
gerrod3patchback[bot]
authored andcommitted
Merge pull request #852 from gerrod3/pt-relative
Fix pull-through caching for indexes with relative urls (cherry picked from commit ebf7b2c)
1 parent 04a0601 commit f22d3c9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGES/842.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed pull-through caching not working for indexes that use relative URLs.

pulp_python/app/pypi/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@ def parse_package(release_package):
260260
return HttpResponse(f"{remote.url} timed out while fetching {package}.", status=504)
261261

262262
if d.headers["content-type"] == "application/vnd.pypi.simple.v1+json":
263-
page = ProjectPage.from_json_data(json.load(open(d.path, "rb")), base_url=remote.url)
263+
page = ProjectPage.from_json_data(json.load(open(d.path, "rb")), base_url=url)
264264
else:
265-
page = ProjectPage.from_html(package, open(d.path, "rb").read(), base_url=remote.url)
265+
page = ProjectPage.from_html(package, open(d.path, "rb").read(), base_url=url)
266266
packages = [
267267
parse_package(p) for p in page.packages if rfilter.filter_release(package, p.version)
268268
]

0 commit comments

Comments
 (0)