diff --git a/src/worker.mjs b/src/worker.mjs index 9771acf..289b616 100644 --- a/src/worker.mjs +++ b/src/worker.mjs @@ -61,6 +61,7 @@ const handleOPTIONS = async () => { const chatVersion = "0.29.0"; const vscodeVersion = "1.102.0"; const apiVersion = "2025-04-01"; +const githubapihost = "api.github.com"; const getToken = async (authKey) => { if (authKey.startsWith("sk-")) { // dumb attempt to hide real auth key from malicious web services const decoded = atob(authKey.substring(3)); @@ -68,10 +69,6 @@ const getToken = async (authKey) => { authKey = decoded; } } - let githubapihost = "api.github.com"; - if (authKey.startsWith("ccu_") || authKey.endsWith("CoCopilot")) { - githubapihost = "api.cocopilot.org"; - } let response = await fetch(`https://${githubapihost}/copilot_internal/v2/token`, { method: "GET", headers: {