johannesboyne / gofakes3

A simple fake AWS S3 object storage (used for local test-runs against AWS S3 APIs)
MIT License
358 stars 81 forks source link

Bugfix: do not overwrite the Last-Modified value with the current time #46

Closed cure closed 4 years ago

cure commented 4 years ago

in GET and HEAD calls, use the stored value instead.

sonarcloud[bot] commented 4 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

codecov-commenter commented 4 years ago

Codecov Report

Merging #46 into master will decrease coverage by 0.01%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
- Coverage   66.69%   66.68%   -0.02%     
==========================================
  Files          27       27              
  Lines        2411     2410       -1     
==========================================
- Hits         1608     1607       -1     
  Misses        567      567              
  Partials      236      236              
Impacted Files Coverage Δ
gofakes3.go 67.52% <ø> (-0.06%) :arrow_down:

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 e89baa3...ee074e4. Read the comment docs.

johannesboyne commented 4 years ago

Hi @cure,

And thanks a lot for your contribution! I am wondering, whether we should move the code instead of deleting it in order to keep returning Last-Modified just with the correct time instead of a newly calculated one - WDYT?

cure commented 4 years ago

Hi @johannesboyne, I'm not sure I understand the question. The Last-Modified header will still be present in the response to the GET or HEAD request; it's populated from the object Metadata, where it was stored by the metadataHeaders function. Does that sound correct?

johannesboyne commented 4 years ago

Ah, you're right! Perfect.