mirror of
https://github.com/ImSingee/hammal.git
synced 2024-11-22 06:39:22 +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 {
|
function rewritePath(orgName: string | null, pathname: string): string {
|
||||||
let splitedPath = pathname.split("/");
|
let splitedPath = pathname.split("/");
|
||||||
|
|
||||||
// /v2/repo -> /v2/library/repo
|
// /v2/repo/manifests/xxx -> /v2/library/repo/manifests/xxx
|
||||||
if (orgName === null && splitedPath.length === 3) {
|
// /v2/repo/blobs/xxx -> /v2/library/repo/blobs/xxx
|
||||||
splitedPath = [splitedPath[0], splitedPath[1], "library", splitedPath[2]]
|
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("/")
|
return splitedPath.join("/")
|
||||||
|
Loading…
Reference in New Issue
Block a user