Skip to content

Commit

Permalink
Strip spaces from the ip= argument (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
whym committed Jun 27, 2016
1 parent e893e75 commit 6d9f759
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions public_html/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ def format_page(form):
.link-result { -moz-user-select: all; -webkit-user-select: all; -ms-user-select: all; user-select: all; }
'''

# remove spaces, the zero-width space and left-to-right mark
if six.PY2:
ip = ip.decode('utf-8')
ip = ip.strip(u' \u200b\u200e')

result = {}
error = False
if do_lookup:
Expand Down

0 comments on commit 6d9f759

Please sign in to comment.