diff --git a/web/templates/base.html b/web/templates/base.html
index 1cc7d4f..e90ff2a 100644
--- a/web/templates/base.html
+++ b/web/templates/base.html
@@ -15,7 +15,7 @@
Network
About
Source
- {{ ip }}
+ {% if ip is not none %}{{ ip }}{% endif %}
diff --git a/web/web.py b/web/web.py
index ff55e58..e78036f 100644
--- a/web/web.py
+++ b/web/web.py
@@ -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