mirror of
https://github.com/cwinfo/yggdrasil-map
synced 2025-08-14 15:58:10 +00:00
Safely omit IP if it is not available.
This commit is contained in:
@@ -5,7 +5,10 @@ app = Flask(__name__)
|
||||
app.config.from_pyfile('web_config.cfg')
|
||||
|
||||
def get_ip():
|
||||
ip = request.headers['x-real-ip']
|
||||
try:
|
||||
ip = request.headers['x-real-ip']
|
||||
except KeyError:
|
||||
ip = None
|
||||
if ip == '10.18.3.20':
|
||||
ip = request.headers['x-atomshare-real-ip']
|
||||
return ip
|
||||
|
Reference in New Issue
Block a user