change ip logging
This commit is contained in:
@@ -31,6 +31,7 @@ app.post("/sendemail", (rreq,rres) => {
|
||||
}
|
||||
|
||||
azureEmail.beginSend(message).then(ares => {
|
||||
console.log(`${rreq.get("cf-connecting-ip")} POST /sendemail returned 200 KEY:${rreq.get("Authorization")}`)
|
||||
rres.sendStatus(200)
|
||||
}).catch(err => {
|
||||
rres.sendStatus(500)
|
||||
@@ -38,7 +39,7 @@ app.post("/sendemail", (rreq,rres) => {
|
||||
})
|
||||
|
||||
} else {
|
||||
console.log(`${rreq.ip} POST /sendemail returned 401`)
|
||||
console.log(`${rreq.get("cf-connecting-ip")} POST /sendemail returned 401`)
|
||||
rres.sendStatus(401)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ app.post("/cider", (rreq,rres) => { // POST stop listening on cider target
|
||||
})
|
||||
|
||||
} else {
|
||||
console.log(`${rreq.ip} POST /cider returned 401`) // TODO: get actual request IP from cloudflare header, this will just log the CF edge IP for now
|
||||
console.log(`${rreq.get("cf-connecting-ip")} POST /cider returned 401`) // log ip of unauthorized requests
|
||||
rres.sendStatus(401) // received auth key was not in database
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user