mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
[PR #585] [MERGED] Fix response date header #985
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?
📋 Pull Request Information
Original PR: https://github.com/wiremock/WireMock.Net/pull/585
Author: @wolf8196
Created: 2/11/2021
Status: ✅ Merged
Merged: 2/11/2021
Merged by: @StefH
Base:
master← Head:master📝 Commits (1)
e24e0b4Fix response date header📊 Changes
1 file changed (+7 additions, -1 deletions)
View changed files
📝
src/WireMock.Net/Owin/Mappers/OwinResponseMapper.cs(+7 -1)📄 Description
I noticed two things while updating from 1.4.1 to 1.4.4.
First - is an issue with formatting in Date header.
The DateTimeFormat.RFC1123Pattern can't be used with string.Format, since it doesn't seem to have {0} placeholder. Also the RFC1123Pattern is supplied not only as the 'format' parameter, but also as 'arg0' parameter.
I replaced string.Format with date.ToString(...).
Here is the output from simple console example:
The second thing - it looks like the date header can't be in local time (at least developer.mozilla.org says that. I didn't read the actual standard, so might be wrong).
I'm not sure if there is a reason current implementation uses DateTime.Now instead of DateTime.UtcNow, but I also added this to PR.
Will appreciate the feedback. Thanks
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.