mirror of
https://github.com/lework/cloudflare-workers.git
synced 2025-09-04 20:16:53 +08:00
Update gcr_proxy.js
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
const hub_host = 'gcr.io'
|
||||
const auth_url = 'https://gcr.io'
|
||||
const workers_url = 'https://gcr.lework.workers.dev'
|
||||
|
||||
/**
|
||||
* static files (404.html, sw.js, conf.js)
|
||||
@@ -83,7 +84,7 @@ async function fetchHandler(e) {
|
||||
if (new_response_headers.get("Www-Authenticate")) {
|
||||
let auth = new_response_headers.get("Www-Authenticate");
|
||||
let re = new RegExp(auth_url, 'g');
|
||||
new_response_headers.set("Www-Authenticate", response_headers.get("Www-Authenticate").replace(re, $custom_domain));
|
||||
new_response_headers.set("Www-Authenticate", response_headers.get("Www-Authenticate").replace(re, workers_url));
|
||||
}
|
||||
|
||||
if (new_response_headers.get("Location")) {
|
||||
@@ -169,4 +170,4 @@ async function proxy(urlObj, reqInit, rawLen) {
|
||||
status,
|
||||
headers: resHdrNew
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user