Skip to content
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

RequestLogExpirationDuration - bug #313

Closed
gregoks opened this issue Aug 11, 2019 · 3 comments
Closed

RequestLogExpirationDuration - bug #313

gregoks opened this issue Aug 11, 2019 · 3 comments
Assignees
Labels

Comments

@gregoks
Copy link

gregoks commented Aug 11, 2019

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 StefH self-assigned this Aug 11, 2019
StefH added a commit that referenced this issue Aug 11, 2019
@StefH
Copy link
Collaborator

StefH commented 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. ;-)

@StefH StefH closed this as completed Aug 11, 2019
@StefH StefH added the bug label Aug 11, 2019
@gregoks
Copy link
Author

gregoks commented Aug 11, 2019

Thanks @StefH! Perhaps check if there are any other DateTime.Now <> DateTime.UtcNow shenanigans :)

@StefH
Copy link
Collaborator

StefH commented Aug 11, 2019

I could not find any other inconsistencies.

StefH added a commit that referenced this issue Aug 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants