merge upstream improvements into etyd-refactor #1

Merged
Enstrayed merged 3 commits from main into etyd-refactor 2024-06-12 12:57:50 -07:00
Showing only changes of commit 39c6a7b22c - Show all commits

View File

@@ -2,12 +2,16 @@ const { app } = require("../index.js")
app.get("/ip", (rreq,rres) => {
let jsonResponse = {
"IP": rreq.get("cf-connecting-ip") || "you_did",
"Country": rreq.get("cf-ipcountry") || "not_connect",
"CfRay": rreq.get("cf-ray") || "via_cloudflare"
"IP": rreq.get("cf-connecting-ip") || rreq.ip,
"Country": rreq.get("cf-ipcountry") || "not_cloudflare",
"CfRay": rreq.get("cf-ray") || "not_cloudflare"
}
rres.send(jsonResponse);
rres.send(jsonResponse)
})
app.get("/headers", (rreq,rres) => {
rres.send(rreq.headers)
})
module.exports = {app}