Potential fix for code scanning alert no. 5: Type confusion through parameter tampering

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
MasterAcnolo
2025-12-27 11:39:30 +01:00
parent 756d2c048e
commit 23da75a17b

View File

@@ -8,7 +8,7 @@ async function infoController(req, res){
const url = req.body.url || req.query.url; // Gérer POST et GET const url = req.body.url || req.query.url; // Gérer POST et GET
/* Si pas d'url ou url invalide*/ /* Si pas d'url, url non-string ou url invalide*/
if (!url || typeof url !== "string" || !isValidUrl(url)) return res.status(400).send("❌ Invalid URL Or Missing"); if (!url || typeof url !== "string" || !isValidUrl(url)) return res.status(400).send("❌ Invalid URL Or Missing");
logger.info(`/Info Request receive by the Info Controller. URL: ${url}`); logger.info(`/Info Request receive by the Info Controller. URL: ${url}`);