Add URL deletion and improve snapshots
Build / build (push) Successful in 11s

This commit is contained in:
2026-07-17 15:51:15 -05:00
parent dcc800fdfc
commit 489f65e0e9
9 changed files with 223 additions and 24 deletions
+5 -3
View File
@@ -18,16 +18,18 @@ function loadExtensionEnv(mode: string): NodeJS.ProcessEnv {
}
function getGiteaHostPermissions(baseUrl?: string): string[] {
const permissions = ["http://*/*", "https://*/*"];
if (!baseUrl?.trim()) {
return [];
return permissions;
}
try {
const url = new URL(baseUrl);
return [`${url.protocol}//${url.host}/*`];
return Array.from(new Set([...permissions, `${url.protocol}//${url.host}/*`]));
} catch {
console.warn(`VITE_GITEA_BASE_URL is not a valid URL: ${baseUrl}`);
return [];
return permissions;
}
}