Skip to content

Commit fc58dc5

Browse files
authored
Merge pull request #859 from pulp/patchback/backports/3.15/ebf7b2c0b0788ba84a45504dc27a66b74b255900/pr-852
[PR #852/ebf7b2c0 backport][3.15] Fix pull-through caching for indexes with relative urls
2 parents 04a0601 + f22d3c9 commit fc58dc5

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)