Skip to content

Commit

Permalink
Decode address to unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
sorz committed Nov 21, 2016
1 parent fc2cb66 commit 628fa23
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sstpd/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def _next_host(self):


def register(self, address):
if isinstance(address, str):
address = address.decode()
addr = ipaddress.ip_address(address)
if addr in self._pool:
raise RegisteredException()
Expand All @@ -45,6 +47,8 @@ def apply(self):


def unregister(self, address):
if isinstance(address, str):
address = address.decode()
addr = ipaddress.ip_address(address)
try:
self._pool.remove(addr)
Expand Down

0 comments on commit 628fa23

Please sign in to comment.