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
committed by GitHub
parent b4312376bb
commit a27b3555f6

View File

@@ -11,8 +11,8 @@ 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 || !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}`);