mirror of
https://github.com/alibaba/higress.git
synced 2026-06-10 05:07:30 +08:00
fix x-ca-timestamp validate (#653)
This commit is contained in:
@@ -347,13 +347,13 @@ bool PluginRootContext::checkPlugin(
|
|||||||
deniedInvalidDate();
|
deniedInvalidDate();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
time_offset = std::abs((long long)(timestamp - current_time));
|
|
||||||
// milliseconds to nanoseconds
|
// milliseconds to nanoseconds
|
||||||
time_offset *= 1e6;
|
timestamp *= 1e6;
|
||||||
// seconds
|
// seconds
|
||||||
if (date.size() < MILLISEC_MIN_LENGTH) {
|
if (date.size() < MILLISEC_MIN_LENGTH) {
|
||||||
time_offset *= 1e3;
|
timestamp *= 1e3;
|
||||||
}
|
}
|
||||||
|
time_offset = std::abs((long long)(timestamp - current_time));
|
||||||
}
|
}
|
||||||
if (time_offset > rule.date_nano_offset) {
|
if (time_offset > rule.date_nano_offset) {
|
||||||
LOG_DEBUG(absl::StrFormat("date expired, offset is: %u",
|
LOG_DEBUG(absl::StrFormat("date expired, offset is: %u",
|
||||||
|
|||||||
Reference in New Issue
Block a user