-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix expiry date comparison in OutputCacheHelper class #24
Conversation
@dotnet-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request fixes a bug in the expiry date comparison in the OutputCacheHelper class by replacing DateTime.Now with DateTime.UtcNow, ensuring the cache expiry logic is evaluated in UTC.
- Use DateTime.UtcNow instead of DateTime.Now in the InsertResponseAsync method
- Addresses potential issues with cache expiry across different time zones
Comments suppressed due to low confidence (1)
src/OutputCacheModuleAsync/OutputCacheHelper.cs:1063
- The replacement of DateTime.Now with DateTime.UtcNow correctly fixes the expiry comparison, but please ensure that the utcExpires value is consistently provided in UTC to avoid potential mismatches.
if (utcExpires > DateTime.UtcNow) {
Addresess #23