Skip to content

Commit cfa4776

Browse files
committed
feat: support search
1 parent f581502 commit cfa4776

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ addEventListener("fetch", (event) => {
55
event.respondWith(handleRequest(event.request));
66
});
77

8-
const dockerHub = "https://registry-1.docker.io";
8+
const registry_dockerHub = "https://registry-1.docker.io";
9+
const index_dockerHub = "https://index.docker.io";
910

1011
const routes = {
1112
// production
12-
["docker." + CUSTOM_DOMAIN]: dockerHub,
13+
["docker." + CUSTOM_DOMAIN]: registry_dockerHub,
1314
["quay." + CUSTOM_DOMAIN]: "https://quay.io",
1415
["gcr." + CUSTOM_DOMAIN]: "https://gcr.io",
1516
["k8s-gcr." + CUSTOM_DOMAIN]: "https://k8s.gcr.io",
@@ -19,7 +20,7 @@ const routes = {
1920
["ecr." + CUSTOM_DOMAIN]: "https://public.ecr.aws",
2021

2122
// staging
22-
["docker-staging." + CUSTOM_DOMAIN]: dockerHub,
23+
["docker-staging." + CUSTOM_DOMAIN]: registry_dockerHub,
2324
};
2425

2526
function routeByHosts(host) {
@@ -54,7 +55,7 @@ async function handleRequest(request) {
5455
}
5556
});
5657
}
57-
const isDockerHub = upstream == dockerHub;
58+
const isDockerHub = upstream == registry_dockerHub;
5859
const authorization = request.headers.get("Authorization");
5960
if (url.pathname == "/v2/") {
6061
const newUrl = new URL(upstream + "/v2/");

0 commit comments

Comments
 (0)