fix: prefix hand-written URLs with basePath for subpath deployments

This commit is contained in:
Linus Rath
2026-05-22 16:38:55 +02:00
parent 58e4a3d117
commit 4b463f9691
6 changed files with 19 additions and 15 deletions
+3 -1
View File
@@ -10,6 +10,8 @@
// installing their own code. Verification kicks in for server-managed
// bundles only (the `managed: true` flag on `InstalledPlugin`).
import { apiFetch } from '@/lib/browser-navigation';
let cachedPubKey: CryptoKey | null = null;
let pubKeyPromise: Promise<CryptoKey | null> | null = null;
@@ -26,7 +28,7 @@ async function importEd25519PublicKey(raw: Uint8Array): Promise<CryptoKey | null
async function fetchPublicKey(): Promise<CryptoKey | null> {
try {
const res = await fetch('/api/plugin-signing-pubkey', { credentials: 'same-origin' });
const res = await apiFetch('/api/plugin-signing-pubkey', { credentials: 'same-origin' });
if (!res.ok) return null;
const data = await res.json() as { algorithm?: string; publicKey?: string };
if (data.algorithm !== 'ed25519' || typeof data.publicKey !== 'string') return null;