diff --git a/debugger/dap_debug_service.ts b/debugger/dap_debug_service.ts index e9dcc68c3c..8f4294b5be 100644 --- a/debugger/dap_debug_service.ts +++ b/debugger/dap_debug_service.ts @@ -213,7 +213,7 @@ async function getPublicKey(): Promise { } // Decode the public key from base64url - const publicKeyBytes = Uint8Array.from(atob(jwk.x.replace(/-/g, '+').replace(/_/g, '/')), c => c.charCodeAt(0)) + const publicKeyBytes = base64urlDecode(jwk.x) // Import as Ed25519 public key const key = await crypto.subtle.importKey( diff --git a/debugger/dap_websocket_server_bun.ts b/debugger/dap_websocket_server_bun.ts index 8db0d853ce..5838be2bad 100644 --- a/debugger/dap_websocket_server_bun.ts +++ b/debugger/dap_websocket_server_bun.ts @@ -186,7 +186,7 @@ async function getPublicKey(): Promise { } // Decode the public key from base64url - const publicKeyBytes = Uint8Array.from(atob(jwk.x.replace(/-/g, '+').replace(/_/g, '/')), c => c.charCodeAt(0)) + const publicKeyBytes = base64urlDecode(jwk.x) // Import as Ed25519 public key const key = await crypto.subtle.importKey(