retreive real client IP
This commit is contained in:
parent
4cda88ccbd
commit
3bc5de3afc
@ -34,7 +34,7 @@ def upload_dump():
|
||||
now = datetime.datetime.now()
|
||||
fulltime = now.isoformat()
|
||||
# client addr:
|
||||
remote_addr = request.environ.get("HTTP_X_REAL_IP", request.remote_addr)
|
||||
remote_addr = request.environ.get("HTTP_X_Real_IP", request.remote_addr)
|
||||
log.write("{} request from {}\n".format(fulltime, remote_addr))
|
||||
# Avec seulement alphanum et tiret:
|
||||
clean_deptname = re.sub(r"[^A-Za-z-]", "", request.form["dept_name"])
|
||||
|
Loading…
Reference in New Issue
Block a user