Skip to content
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

[BUG] Mime decoder for attachment filename (Content-Disposition) #853

Open
taalexlistex opened this issue Dec 20, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@taalexlistex
Copy link

taalexlistex commented Dec 20, 2024

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!

@taalexlistex taalexlistex added the bug Something isn't working label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants