fix: added url encoding and decoding for goose recipe url (#2845)

This commit is contained in:
Lifei Zhou
2025-06-10 23:02:10 +10:00
committed by GitHub
parent 1a73708a2f
commit f23fc192e4
4 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -254,9 +254,10 @@ app.on('open-url', async (_event, url) => {
if (parsedUrl.hostname === 'bot' || parsedUrl.hostname === 'recipe') {
let recipeConfig = null;
const configParam = parsedUrl.searchParams.get('config');
const base64 = decodeURIComponent(configParam || '');
if (configParam) {
try {
recipeConfig = JSON.parse(Buffer.from(configParam, 'base64').toString('utf-8'));
recipeConfig = JSON.parse(Buffer.from(base64, 'base64').toString('utf-8'));
} catch (e) {
console.error('Failed to parse bot config:', e);
}