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

Fix response date header #585

Merged
merged 1 commit into from
Feb 11, 2021
Merged

Fix response date header #585

merged 1 commit into from
Feb 11, 2021

Conversation

wolf8196
Copy link
Contributor

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:

Current: ddd, dd MMM yyyy HH':'mm':'ss 'GMT'
Fix: Thu, 11 Feb 2021 11:53:02 GMT

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

@sonarcloud
Copy link

sonarcloud bot commented Feb 11, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Feb 11, 2021

Codecov Report

Merging #585 (e24e0b4) into master (ddcf2b2) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #585      +/-   ##
==========================================
+ Coverage   75.86%   75.88%   +0.02%     
==========================================
  Files         141      141              
  Lines        5431     5437       +6     
  Branches      546      546              
==========================================
+ Hits         4120     4126       +6     
  Misses       1148     1148              
  Partials      163      163              
Impacted Files Coverage Δ
...rc/WireMock.Net/Owin/Mappers/OwinResponseMapper.cs 92.70% <100.00%> (+0.48%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ddcf2b2...e24e0b4. Read the comment docs.

@StefH
Copy link
Collaborator

StefH commented Feb 11, 2021

@wolf8196 Thanks a lot.

I'll merge this and create a new version.

@StefH StefH merged commit 7a8f4c3 into WireMock-Net:master Feb 11, 2021
@StefH StefH added the bug label Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants