Skip to content

Commit 8b2fed9

Browse files
Manu ChaudharyManu Chaudhary
authored andcommitted
Wrong expire fix
1 parent 7ddfd07 commit 8b2fed9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

imagekitio/utils/calculation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def hamming_distance(first: str, second: str) -> int:
2323
def get_authenticated_params(token, expire, private_key):
2424
default_expire = int(dt.now().strftime("%s")) + DEFAULT_TIME_DIFF
2525
token = token or str(uuid.uuid4())
26+
expire = expire or default_expire
2627
auth_params = {"token": token, "expire": expire, "signature": ""}
2728

2829
if not private_key:
@@ -33,8 +34,8 @@ def get_authenticated_params(token, expire, private_key):
3334
digestmod=hashlib.sha1,
3435
).hexdigest()
3536

36-
auth_params["token"] = token or str(uuid.uuid4())
37-
auth_params["expire"] = expire or default_expire
37+
auth_params["token"] = token
38+
auth_params["expire"] = expire
3839
auth_params["signature"] = signature
3940

4041
return auth_params

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setuptools.setup(
1010
name="imagekitio",
11-
version="2.2.2",
11+
version="2.2.3",
1212
description="Python wrapper for the ImageKit API",
1313
long_description=long_description,
1414
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)