diff --git a/backend/src/controllers/endpointController.ts b/backend/src/controllers/endpointController.ts index 0ce6825..dbdc0ea 100644 --- a/backend/src/controllers/endpointController.ts +++ b/backend/src/controllers/endpointController.ts @@ -492,9 +492,10 @@ export const exportEndpoint = async (req: AuthRequest, res: Response) => { const encrypted = encryptEndpointData(exportData); - const safeFileName = endpoint.name.replace(/[^a-zA-Z0-9_\-а-яА-ЯёЁ]/g, '_'); + const safeFileName = endpoint.name.replace(/[^a-zA-Z0-9_\-]/g, '_'); + const encodedFileName = encodeURIComponent(endpoint.name.replace(/[\/\\:*?"<>|]/g, '_')) + '.kabe'; res.setHeader('Content-Type', 'application/octet-stream'); - res.setHeader('Content-Disposition', `attachment; filename="${safeFileName}.kabe"`); + res.setHeader('Content-Disposition', `attachment; filename="${safeFileName}.kabe"; filename*=UTF-8''${encodedFileName}`); res.send(encrypted); } catch (error) { console.error('Export endpoint error:', error);