Potential fix for code scanning alert no. 6: Information exposure through a stack trace

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
2025-06-10 00:35:27 +02:00
committed by GitHub
parent adea8ae6b7
commit 33577bb2d5

View File

@ -209,14 +209,17 @@ export default {
});
} catch (error) {
console.error('Worker error:', error);
return new Response(JSON.stringify(formatError(error)), {
console.error('Worker error:', error); // Log full error details, including stack trace
return new Response(
JSON.stringify({ message: 'An internal server error occurred. Please try again later.' }),
{
status: 500,
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*'
}
});
}
);
}
},
};