content-disposition icon indicating copy to clipboard operation
content-disposition copied to clipboard

Allow for Non-Standard Charset Name

Open s25g5d4 opened this issue 8 years ago • 1 comments

Hello,

I encountered a server that returns content-disposition: attachment; filename="file.png"; filename*=utf8''file.png which is, according to RFC 5987, malformed because the charset should be utf-8, rather than utf8. When trying to decode content-disposition, it will fail at https://github.com/jshttp/content-disposition/blob/9908a229a1cd110132fbea098ec94d13b4c05e7c/index.js#L286. It is not my server and I have no way to ask them to change, so if you can fix this (either by accept utf8 or fallback to filename) that would be appreciated.

s25g5d4 avatar Dec 21 '17 16:12 s25g5d4

Yea, I agree that there needs to be at least one of those options (the very minimum to be able to ignore the unknown encoding because there wasn't a parse error, it parsed fine but just didn't know how to decode).

dougwilson avatar Mar 22 '18 02:03 dougwilson