diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2011-09-27 18:08:46 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2011-09-27 18:08:55 +0200 |
commit | 152c8564e92766bc294bfbb7ed81281b653e6760 (patch) | |
tree | 55ccbd676abea77dfda01dc0a33a16b4e98c0d23 | |
parent | 1398da5d22c4869e39e3666f6187f2710b1d7315 (diff) | |
download | sites-152c8564e92766bc294bfbb7ed81281b653e6760.tar.gz sites-152c8564e92766bc294bfbb7ed81281b653e6760.tar.bz2 sites-152c8564e92766bc294bfbb7ed81281b653e6760.zip |
do not fail if reverse dns is not available
-rwxr-xr-x | index.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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): |