Skip to content

Commit acb1f5e

Browse files
committed
absolute timestamp diff for better comparison
1 parent 393f63a commit acb1f5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def validate_timestamp(self) -> None:
5959
raise ValueError("expected x-timestamp to be epoch int")
6060

6161
current_time = int(time.time())
62-
if int(timestamp) - current_time > self.TIME_WINDOW:
62+
if abs(int(timestamp) - current_time) > self.TIME_WINDOW:
6363
raise ValueError("Request is too old or too far in the future")
6464

6565
def validate_signature(self):

0 commit comments

Comments
 (0)