mirrorbits
mirrorbits copied to clipboard
Evaluate If-Modified-Since header
It was request in issue #115 to support the If-Modified-Since header. This is a first attempt to evaluate the If-Modified-Since header.
@lazka This is a first attempt to support the If-Modified-Since header. Do you have the means to test this? I copied the source code from net/http
, as suggested, so I don't expect major defects but there is no test suite and I don't have a test system at the moment.
@etix Most of this pull request has been copied from net/http
. How would you like me to attribute this? I will add the attribution to the commit message. However, I don't know whether I should add the attribution to the license header or the to every copied piece of source code.
That looks to me. I need to check the spec, but it seems logical.
Tested and it doesn't work. The code added is good, however the issue is that when checkIfModifiedSince
is called, we don't know yet the mod time of the file. The function fileInfo := filesystem.NewFileInfo(urlPath)
only initialize the struct with the file path and nothing else (check the code in question at https://github.com/etix/mirrorbits/pull/131/files#diff-c7bd264032bb4b6d96f25a74e79e88d7c9842f310bea423fb54f76297919a8efR287-R293)
I added the missing bits and propose a new MR: https://github.com/etix/mirrorbits/pull/169
This one can be closed as https://github.com/etix/mirrorbits/pull/169 was merged
See #169
And #169 is merged. Issue fixed.