From 1ef1c9d1e84ccaa003704931f35c49393688e166 Mon Sep 17 00:00:00 2001 From: uo277310 Date: Mon, 29 Apr 2024 20:18:50 +0200 Subject: [PATCH] Nuevo intento de arreglo de seguridad --- gatewayservice/gateway-service.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gatewayservice/gateway-service.js b/gatewayservice/gateway-service.js index 76f33380..2e629696 100644 --- a/gatewayservice/gateway-service.js +++ b/gatewayservice/gateway-service.js @@ -112,13 +112,11 @@ app.get('/getAllGeneratedQuestions', async (req, res) => { app.get('/getRecords/:userId', async (req, res) => { try { - - const userId = req.params.userId; - + const userId = encodeURIComponent(req.params.userId); const recordsResponse = await axios.get(`${recordServiceUrl}/getRecords/${userId}`); res.json(recordsResponse.data); } catch (error) { - res.status(500).json({ error: 'Error interno del servidor' }); + res.status(500).json({ error: 'Error interno del servidor' }); } });