summaryrefslogtreecommitdiffstats
path: root/index.py
diff options
context:
space:
mode:
Diffstat (limited to 'index.py')
-rwxr-xr-xindex.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/index.py b/index.py
index c0a38f9..7e82cdf 100755
--- a/index.py
+++ b/index.py
@@ -86,8 +86,13 @@ class new:
return False
def get_user_information(self):
+ try:
+ host = gethostbyaddr(ctx.ip)[0]
+ except:
+ host = ctx.ip
+
return {'ip': ctx.ip,
- 'host': gethostbyaddr(ctx.ip)[0],
+ 'host': host,
'valid': self.validate(ctx.ip)}
def GET(self):