OpenAPITools / OpenAPITools/openapi-generator-cli
[BUG] Mime decoder for attachment filename (Content-Disposition)
Open
@kay-schecker is already working on this.
Since Dec 20, 2024.
bug
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 208
- Avg merge
- 7h 12m
- Merged PRs (30d)
- 6
Description
I have MIME encoded filename in Content-Disposition header like "=?UTF-8?Q?Invoice_4.png?="
ApiClient does not decode it before sanitizing and fails on temporary file creation.
if (matcher.find()) {
filename = sanitizeFilename(matcher.group(1));
}
ApiClient.prepareDownloadFile must decode filename!
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>
</dependency>
filename = sanitizeFilename(MimeUtility.decodeText(matcher.group(1)));
This solution works fine!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.