From 152c8564e92766bc294bfbb7ed81281b653e6760 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 27 Sep 2011 18:08:46 +0200 Subject: do not fail if reverse dns is not available --- index.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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): -- cgit v1.2.3-1-g7c22