Skip to content

Commit

Permalink
covered edge cases for ip addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei committed Mar 24, 2017
1 parent 80cf7ea commit ce0ffcd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion microURL.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def route_micro(micro):
return redirect(temp)
elif domaincheck(temp):
return redirect("http://" + temp)
elif ipcheck(temp.split(':')[0]):
elif ipcheck(temp.split(':')[0]) and urlcheck('http://' + temp):
# checks for plain ip or an ip with something after it
return redirect("http://" + temp)
else:
abort(404)
Expand Down

0 comments on commit ce0ffcd

Please sign in to comment.