mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
RequestLogExpirationDuration - bug #196
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gregoks on GitHub (Aug 11, 2019).
Originally assigned to: @StefH on GitHub.
Hi,
In OwinRequestMapper (line 55) you are setting RequestMessage.DateTime to DateTime.UtcNow:
return new RequestMessage(urldetails, method, clientIP, body, headers, cookies) { DateTime = DateTime.UtcNow };Then in WireMockMiddleWare (line 175) when you are checking for expiration of that time, you are using DateTime.Now instead of DateTime.UtcNow:
var checkTime = DateTime.Now.AddHours(-_options.RequestLogExpirationDuration.Value);That's causing you invalid behavior.
Please check.
Thanks,
Greg
@StefH commented on GitHub (Aug 11, 2019):
Good catch, I've fixed this with PR #314
But you are also allowed to create a PR for other issues you find. ;-)
@gregoks commented on GitHub (Aug 11, 2019):
Thanks @StefH! Perhaps check if there are any other DateTime.Now <> DateTime.UtcNow shenanigans :)
@StefH commented on GitHub (Aug 11, 2019):
I could not find any other inconsistencies.