Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

New tip for mod_zip + SSL; Fix: allow one-character filenames #19

Merged
merged 5 commits into from Mar 22, 2013

Conversation

3 participants
Contributor

frol commented Mar 21, 2013

No description provided.

devgs and others added some commits Apr 12, 2012

added X-Archive-Name-Sep header
Annotation:

 Sometimes there might be a problem converting UTF-8 to zips native
 charset(CP866), because it's not 1:1 conversion. So my solution is to
allow
 developers provide their own version of converted filename and pass it
 to mod_zip along with UTF-8 filename which will go straight to Unicode
 path extra field (thanks to tony2001). So separator is a solution that
doesn't
 break current format. And allows passing file name in both formats as
one string.

 Normally we pass:
 CRC32 <size> <path> <filename>\n
 ...
 * <filename> passed to archive as filename w/o conversion
 * UFT-8 flag for filename is set

 tony2001's X-Archive-Charset: <charset> way:
 CRC32 <size> <path> <filename>\n
 ...
 * <filename> is accepted to be UTF-8 string
 * <filename>, converted to <charset> and passed to archive as filename
 * <filename> passed to Unicode path extra field
 * UFT-8 flag for filename is not set

 My X-Archive-Name-Sep: <sep> solution:
 CRC32 <size> <path> <native-filename><sep><utf8-filename>\n
 ...
 * <native-filename> passed to archive as filename w/o conversion
 * <utf8-filename> passed to Unicode path extra field
 * UFT-8 flag for filename is not set

 You just need to provide separator that won't interfere with file
names. I suggest using '/'
 as it is ASCII character and forbidden on most (if not all) platforms
as a part of filename.

 Empty separator string means no UTF-8 version provided. Usefull when we
need to pass only
 names encoded in native charset. It's equal to 'X-Archive-Charset:
native;'.
 Note: Currently it is impossible after '[PATCH] Support for UTF-8 file
names.'(4f61592)
 because UFT-8 flag (zip_utf8_flag) is set default for templates.
Owner

evanmiller commented Mar 22, 2013

Seems fine to me!

evanmiller added a commit that referenced this pull request Mar 22, 2013

Merge pull request #19 from frol/patch-1
New tip for mod_zip + SSL; Fix: allow one-character filenames

@evanmiller evanmiller merged commit 9e903b2 into evanmiller:master Mar 22, 2013

dup2 pushed a commit to cargoserver/mod_zip that referenced this pull request Sep 30, 2015

Merge pull request #19 from frol/patch-1
New tip for mod_zip + SSL; Fix: allow one-character filenames
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment