Fix security vulnerabilities

This commit is contained in:
gpt-engineer-app[bot]
2025-10-16 20:01:21 +00:00
parent f176c28df6
commit cdd9e6c8c6
7 changed files with 192 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
import { serve } from 'https://deno.land/std@0.168.0/http/server.ts';
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.57.4';
import { sanitizeError } from '../_shared/errorSanitizer.ts';
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
@@ -278,9 +279,10 @@ serve(async (req) => {
} catch (error) {
console.error('[Export] Error:', error);
const sanitized = sanitizeError(error, 'export-user-data');
return new Response(
JSON.stringify({
error: error instanceof Error ? error.message : 'An unexpected error occurred',
...sanitized,
success: false
}),
{ status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }