Skip to content

Commit

Permalink
fix: Make the URL check more robust (fixes #32)
Browse files Browse the repository at this point in the history
  • Loading branch information
skorokithakis committed Jun 15, 2017
1 parent e60207b commit bd2f38e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions shortuuid/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ def uuid(self, name=None, pad_length=None):
# If no name is given, generate a random UUID.
if name is None:
uuid = _uu.uuid4()
elif "http" not in name.lower():
uuid = _uu.uuid5(_uu.NAMESPACE_DNS, name)
else:
elif name.lower().startswith(("http://", "https://")):
uuid = _uu.uuid5(_uu.NAMESPACE_URL, name)
else:
uuid = _uu.uuid5(_uu.NAMESPACE_DNS, name)
return self.encode(uuid, pad_length)

def random(self, length=None):
Expand Down

0 comments on commit bd2f38e

Please sign in to comment.