Remove cocopilot support

This commit is contained in:
johnd0e
2025-07-12 22:20:03 +02:00
parent 9407aeb905
commit c7cc3f781c

View File

@@ -61,6 +61,7 @@ const handleOPTIONS = async () => {
const chatVersion = "0.29.0"; const chatVersion = "0.29.0";
const vscodeVersion = "1.102.0"; const vscodeVersion = "1.102.0";
const apiVersion = "2025-04-01"; const apiVersion = "2025-04-01";
const githubapihost = "api.github.com";
const getToken = async (authKey) => { const getToken = async (authKey) => {
if (authKey.startsWith("sk-")) { // dumb attempt to hide real auth key from malicious web services if (authKey.startsWith("sk-")) { // dumb attempt to hide real auth key from malicious web services
const decoded = atob(authKey.substring(3)); const decoded = atob(authKey.substring(3));
@@ -68,10 +69,6 @@ const getToken = async (authKey) => {
authKey = decoded; 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`, { let response = await fetch(`https://${githubapihost}/copilot_internal/v2/token`, {
method: "GET", method: "GET",
headers: { headers: {