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