@forklaunch/core 1.3.13 → 1.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/http/index.js CHANGED
@@ -422,7 +422,16 @@ async function getCachedJwks(jwksPublicKeyUrl) {
422
422
  return cachedJwks.value;
423
423
  } else {
424
424
  const jwksResponse = await fetch(jwksPublicKeyUrl);
425
- const jwks = (await jwksResponse.json()).keys;
425
+ const text = await jwksResponse.text();
426
+ if (!text) {
427
+ if (cachedJwks.value) {
428
+ return cachedJwks.value;
429
+ }
430
+ throw new Error(
431
+ `JWKS endpoint returned empty response (status ${jwksResponse.status})`
432
+ );
433
+ }
434
+ const jwks = JSON.parse(text).keys;
426
435
  cachedJwks.value = jwks;
427
436
  cachedJwks.lastUpdated = /* @__PURE__ */ new Date();
428
437
  cachedJwks.ttl = parseInt(