Skip to content

Commit 8f22204

Browse files
authored
Fix verifySignature timestamp units
1 parent ff53df7 commit 8f22204

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cloudinary-core/src/main/java/com/cloudinary/api/signing/NotificationRequestSignatureVerifier.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public boolean verifySignature(String body, String timestamp, String signature)
5454
*
5555
* @param body notification message body, represented as string
5656
* @param timestamp value of X-Cld-Timestamp custom HTTP header of notification message, representing notification
57-
* issue timestamp
57+
* issue timestamp in seconds
5858
* @param signature actual signature value, usually passed via X-Cld-Signature custom HTTP header of notification
5959
* message
6060
* @param secondsValidFor the amount of time, in seconds, the notification message is considered valid by client
@@ -69,7 +69,7 @@ public boolean verifySignature(String body, String timestamp, String signature,
6969
}
7070

7171
return verifySignature(body, timestamp, signature) &&
72-
(System.currentTimeMillis() - parsedTimestamp <= secondsValidFor * 1000L);
72+
(System.currentTimeMillis() / 1000L - parsedTimestamp <= secondsValidFor);
7373
}
7474

7575
}

0 commit comments

Comments
 (0)