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

Generated zips store the current time, so they aren't reproducible #74

Open
nahuel opened this issue Jun 19, 2019 · 1 comment
Open

Comments

@nahuel
Copy link

nahuel commented Jun 19, 2019

When you generate a .zip file using mod_zip, the current time (the one of the nginx host) is always stored inside the .zip. Here the time is read:

unix_time = time(NULL);

This is later stored in the File Header/Last Modification Time/Date fields, the File Header/Extra Field parameter and in the .zip Central Directory. So the generated .zip file is always different unless you download it in the exact same second.

This affects resumability, because you can get inconsistent datetimes if you download the .zip file using multiple (Range) requests and some request starts from the middle offset of a datetime field bytes. Is also very troublesome when you need the .zip generated to be always the same (because you are check-summing the entire .zip file in a client application).

Possible fixes:

A- Modify mod_zip to store NULL/1970 dates on zips, making it the default behaviour or one behind an option.
B- Get the file dates from upstream files "Last-Modified" headers
C- Add a new date field to the space-separated file list.

@nanaya
Copy link
Contributor

nanaya commented Jan 11, 2024

Would a PR just removing the date (setting it to null/1970) be accepted as interim fix? I think it's still better than having inconsistent response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants