Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.
TypeScript
fix(updates): resolve relative registry pagination URL so tag listing doesn't crash (#945)
Chris Sherwood5de58da4b7f2
diff --git a/admin/app/services/container_registry_service.ts b/admin/app/services/container_registry_service.tsindex afdd39d4..2fc465de 100644--- a/admin/app/services/container_registry_service.ts+++ b/admin/app/services/container_registry_service.ts@@ -139,11 +139,17 @@ export class ContainerRegistryService {allTags.push(...data.tags)}- // Handle pagination via Link header+ // Handle pagination via Link header. Per the OCI/Docker registry spec the next-page+ // URL is relative (e.g. "/v2/<repo>/tags/list?last=<tag>&n=1000"), so it must be+ // resolved against the registry origin before re-fetching — assigning the raw relative+ // path to `url` makes fetch() throw "Failed to parse URL". This silently broke update+ // checks for any repo with >1000 tags (e.g. ollama/ollama, filebrowser/filebrowser),+ // which is the root cause of #945. new URL(relative, base) also passes absolute+ // next-URLs through unchanged, so it's safe for registries that return those.const linkHeader = response.headers.get('link')if (linkHeader) {const match = linkHeader.match(/<([^>]+)>;\s*rel="next"/)- url = match ? match[1] : ''+ url = match ? new URL(match[1], `https://${parsed.registry}`).toString() : ''} else {url = ''}