mirror of
https://github.com/MrUnknownDE/utools.git
synced 2026-04-09 01:43:48 +02:00
add debug in traceroute endpoint
This commit is contained in:
@@ -254,7 +254,17 @@ app.get('/api/ping', async (req, res) => {
|
||||
app.get('/api/traceroute', async (req, res) => {
|
||||
const targetIp = req.query.targetIp;
|
||||
|
||||
// --- DEBUGGING START ---
|
||||
console.log(`--- TRACEROUTE Request ---`);
|
||||
console.log(`Raw req.query.targetIp:`, req.query.targetIp);
|
||||
console.log(`Type of targetIp:`, typeof targetIp);
|
||||
console.log(`Value of targetIp before validation: "${targetIp}"`);
|
||||
// --- DEBUGGING END ---
|
||||
|
||||
if (!isValidIp(targetIp)) {
|
||||
// --- DEBUGGING START ---
|
||||
console.log(`isValidIp returned false for "${targetIp}"`);
|
||||
// --- DEBUGGING END ---
|
||||
return res.status(400).json({ error: 'Invalid target IP address provided.' });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user