Encode non-printable character in Content-Disposition parameter

Prior to this commit, the "filename" parameter value for the
"Content-Disposition" header would contain non-printable characters,
causing parsing issues for HTTP clients.
This commit ensures that all non-printable characters are encoded.

Fixes gh-35034
This commit is contained in:
Brian Clozel
2025-06-12 08:39:29 +02:00
parent e86dc9ad95
commit f0e7b42704
2 changed files with 8 additions and 0 deletions
@@ -68,6 +68,7 @@ public final class ContentDisposition {
for (int i=33; i<= 126; i++) {
PRINTABLE.set(i);
}
PRINTABLE.set(34, false); // "
PRINTABLE.set(61, false); // =
PRINTABLE.set(63, false); // ?
PRINTABLE.set(95, false); // _