Skip to content

Commit ac3d290

Browse files
authored
Update index.js
1 parent 576d45b commit ac3d290

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ app.get('/', async (req, res) => {
1818
console.log("========USER AGENT=======")
1919
console.log(req.headers["user-agent"])
2020

21-
const ip = req.headers['x-forwarded-for']
21+
const ip = req.headers['x-forwarded-for'].split(",")[0].trim()
2222
const agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36';
2323

2424
const url = "https://api.ip8.com/ip/lookup/" + ip;

0 commit comments

Comments
 (0)