Quote question marks in content-disposition

This commit ensures that question marks are encoded, in accordance
with RFC 2047, section 4.2, rule (3).

Closes gh-30252
This commit is contained in:
luozhenyu
2023-03-31 14:16:37 +08:00
committed by Arjen Poutsma
parent a465b16f7c
commit 5a4a46af78
2 changed files with 17 additions and 1 deletions

View File

@@ -599,7 +599,7 @@ public final class ContentDisposition {
}
private static boolean isPrintable(byte c) {
return (c >= '!' && c <= '<') || (c >= '>' && c <= '~');
return (c >= '!' && c <= '<') || (c >= '@' && c <= '~') || c == '>';
}
private static String encodeQuotedPairs(String filename) {