Fix requests with empty wish-URLs
This commit is contained in:
parent
d02c458e2a
commit
b98c189f7c
1 changed files with 1 additions and 1 deletions
|
@ -43,7 +43,7 @@ def short(shortLink=""):
|
|||
def insertIdUnique(longUrl, idToCheck=None):
|
||||
hashUrl = hashlib.sha256(longUrl.encode()).digest()
|
||||
base64Url = base64.urlsafe_b64encode(hashUrl).decode()
|
||||
if idToCheck == None:
|
||||
if idToCheck == None or idToCheck == "":
|
||||
idToCheck = base64Url[:4]
|
||||
|
||||
conn = sqlite3.connect("data/links.sqlite")
|
||||
|
|
Loading…
Reference in a new issue