mirrorbits icon indicating copy to clipboard operation
mirrorbits copied to clipboard

Evaluate If-Modified-Since header

Open ott opened this issue 2 years ago • 3 comments

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.

ott avatar Sep 17 '22 21:09 ott

@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.

ott avatar Sep 17 '22 21:09 ott

@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.

ott avatar Sep 17 '22 21:09 ott

That looks to me. I need to check the spec, but it seems logical.

jbkempf avatar Oct 31 '23 07:10 jbkempf

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

elboulangero avatar Mar 11 '24 06:03 elboulangero

This one can be closed as https://github.com/etix/mirrorbits/pull/169 was merged

elboulangero avatar Mar 13 '24 01:03 elboulangero

See #169

jbkempf avatar Apr 08 '24 05:04 jbkempf

And #169 is merged. Issue fixed.

jbkempf avatar Apr 08 '24 05:04 jbkempf