File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ addEventListener("fetch", (event) => {
77
88const registry_dockerHub = "https://registry-1.docker.io" ;
99const index_dockerHub = "https://index.docker.io" ;
10+ const registry_quay = "https://quay.io" ;
11+ const index_quay = "https://quay.io" ;
1012
1113const routes = {
1214 // production
@@ -56,10 +58,20 @@ async function handleRequest(request) {
5658 } ) ;
5759 }
5860 const isDockerHub = upstream == registry_dockerHub ;
61+ const isQuay = upstream == registry_quay ;
5962 const authorization = request . headers . get ( "Authorization" ) ;
6063
61- if ( url . pathname == "/v1/search" && isDockerHub ) {
62- const newUrl = new URL ( index_dockerHub + "/v1/search" ) ;
64+ if ( url . pathname == "/v1/search" ) {
65+ let newUrl = url
66+
67+ if ( isDockerHub ) {
68+ newUrl = new URL ( index_dockerHub + "/v1/search" ) ;
69+ } else if ( isQuay ) {
70+ newUrl = new URL ( index_quay + "/v1/search" ) ;
71+ } else {
72+ newUrl = url
73+ }
74+
6375 newUrl . search = url . search ;
6476
6577 const headers = new Headers ( ) ;
You can’t perform that action at this time.
0 commit comments