From 4253679c49bc3e8cee4bf998ff066cec39864fc3 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Tue, 16 Jan 2024 04:23:34 +0530 Subject: [PATCH] testing bug fix --- routes/is-tor.js | 2 +- routes/is-tor.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/is-tor.js b/routes/is-tor.js index d8fef46..2f17d58 100644 --- a/routes/is-tor.js +++ b/routes/is-tor.js @@ -4,7 +4,7 @@ const axios = require('axios'); router.get('/', async (req, res) => { try { - const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress; + const ip = req.socket.remoteAddress; const response = await axios.get(`https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=${ip}`); const isTor = response.data.includes(ip); res.json({ isTor, ip }); diff --git a/routes/is-tor.min.js b/routes/is-tor.min.js index 7ea81d9..e83cfa6 100644 --- a/routes/is-tor.min.js +++ b/routes/is-tor.min.js @@ -1 +1 @@ -const express=require("express"),router=express.Router(),axios=require("axios");router.get("/",(async(req,res)=>{try{const ip=req.headers["x-forwarded-for"]||req.socket.remoteAddress,isTor=(await axios.get(`https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=${ip}`)).data.includes(ip);res.json({isTor:isTor,ip:ip})}catch(error){res.status(500).json({error:error.message})}})),module.exports=router; \ No newline at end of file +const express=require("express"),router=express.Router(),axios=require("axios");router.get("/",(async(req,res)=>{try{const ip=req.socket.remoteAddress,isTor=(await axios.get(`https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=${ip}`)).data.includes(ip);res.json({isTor:isTor,ip:ip})}catch(error){res.status(500).json({error:error.message})}})),module.exports=router; \ No newline at end of file