-
Notifications
You must be signed in to change notification settings - Fork 100
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
It does not correctly extract long filename. #109
Comments
Thanks, I don't remember seeing that in the RFCs, will have look into it more. |
This is currently implemented in the mime package: https://golang.org/src/mime/mediatype.go?s=4428:4473#L167 As is, you will get a "hex percent-encoded" result, but if the encoding is not us-ascii or utf-8 then filename data on the same line as the encoding declaration will be omitted. |
@jhillyerd If we want to implement this fix we have two options: PR into golang mime package, which would bring the "enmime/internal/coding/charsets.go" for the ride, or copy out ParseMediaType such that we can amend it. Negative reasons to support copying and amending:
Positive reasons to support copying and amending:
|
Here is a playground exposing the result: https://play.golang.org/p/zOX_CQAV23l |
Just tested on playground, this is still broken in the current version of Go (only us-ascii and utf-8 supported). I think copying ParseMediaType into our codebase is the better option. I'm not sure how frequently this comes up in the wild. If others run into this, please comment. |
What I did:
If the filename is too long, it is stored separately.
But when I call (*enmime.Part).FileName, it only reads the last FileName.
example)
In the above example, the filename is the sum of filename*0* ~ filename*1*, but only filename*1* is read.
What I expected:
sum of filename*0* ~ filename*1*
What I got:
only value of filename*1*
Release or branch I am using:
both master and release v0.4.0
If the filename is longer, it can be as follows:
The text was updated successfully, but these errors were encountered: