http-server-static-content icon indicating copy to clipboard operation
http-server-static-content copied to clipboard

Issue with If-Modified-Since HTTP header

Open b-viguier opened this issue 1 year ago • 0 comments

Hi there 👋🙂 I noticed that when I modify a file served by DocumentRoot, I have to force the refresh in my browser to actually see the updated file. After some debugging, I think there is an inversion in the order of comparison: https://github.com/amphp/http-server-static-content/blob/2.x/src/DocumentRoot.php#L304C49-L304C66

The code returns "unmodified" status if $mtime > $ifModifiedSince, but if I understand correctly it's the opposite, if $mtime > $ifModifiedSince it means that the file has been updated. (Corresponding doc for reference)

I'm currently running version 1, but as far as I can see the bug is present on branch 2 as well. It doesn't seem to be covered by tests.

By the way, thank you very much for your work on this awesome library 😊

b-viguier avatar Nov 12 '23 17:11 b-viguier