We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e63efac commit 75beb32Copy full SHA for 75beb32
src/main/java/com/wechat/pay/contrib/apache/httpclient/auth/WechatPay2Validator.java
@@ -73,9 +73,9 @@ protected final void validateParameters(CloseableHttpResponse response) {
73
} else {
74
Header timestamp = response.getFirstHeader("Wechatpay-Timestamp");
75
try {
76
- Instant instant = Instant.ofEpochSecond(Integer.parseInt(timestamp.getValue()));
77
- // 拒绝5分钟之前的应答
78
- if (Duration.between(instant, Instant.now()).toMinutes() >= 5) {
+ Instant instant = Instant.ofEpochSecond(Long.parseLong(timestamp.getValue()));
+ // 拒绝5分钟之外的应答
+ if (Duration.between(instant, Instant.now()).abs().toMinutes() >= 5) {
79
throw parameterError("timestamp=[%s] expires, request-id=[%s]",
80
timestamp.getValue(), requestId);
81
}
0 commit comments