evanmiller / mod_zip

Streaming ZIP archiver for nginx 📦
https://www.nginx.com/resources/wiki/modules/zip/
BSD 3-Clause "New" or "Revised" License
215 stars 64 forks source link

Added ability to declare empty directory #86

Closed devgs closed 3 years ago

devgs commented 3 years ago

We had a need to be able to create archives that contain empty directories. It was not possible with existing tools, since directories are implicitly declared when the file paths contain their names. For this reason I've added a special marker @directory that is recognized in place of an url. So, as per example, you can now declare them:

1034ab38 428    /foo.txt   My Document1.txt
83e8110b 100339 /bar.txt   My Other Document1.txt
0        0      @directory My empty directory
evanmiller commented 3 years ago

Can you please add this feature to the test suite to ensure it doesn't break in the future? See the t/ directory.

devgs commented 3 years ago

@evanmiller Done. Added test cases to cover empty directories. Excuse my force pushes, didn't want to spam the commit history because of small mistakes.

evanmiller commented 3 years ago

@devgs Thanks!