mirror of
https://github.com/ImSingee/hammal.git
synced 2024-11-21 21:39:23 +08:00
support docker official images
This commit is contained in:
parent
11ceb5fc85
commit
554ee35d6b
@ -43,9 +43,10 @@ function hostByOrgName(orgName: string|null): string {
|
||||
function rewritePath(orgName: string | null, pathname: string): string {
|
||||
let splitedPath = pathname.split("/");
|
||||
|
||||
// /v2/repo -> /v2/library/repo
|
||||
if (orgName === null && splitedPath.length === 3) {
|
||||
splitedPath = [splitedPath[0], splitedPath[1], "library", splitedPath[2]]
|
||||
// /v2/repo/manifests/xxx -> /v2/library/repo/manifests/xxx
|
||||
// /v2/repo/blobs/xxx -> /v2/library/repo/blobs/xxx
|
||||
if (orgName === null && splitedPath.length === 5 && (splitedPath[3] === "manifests" || splitedPath[3] === "blobs")) {
|
||||
splitedPath = [splitedPath[0], splitedPath[1], "library", splitedPath[2], splitedPath[3], splitedPath[4]]
|
||||
}
|
||||
|
||||
return splitedPath.join("/")
|
||||
|
Loading…
Reference in New Issue
Block a user