Support Windows path in ContentDisposition::parse

This commit makes sure that ContentDisposition::parse supports Windows
path with a backslash.

Closes gh-30111
This commit is contained in:
Arjen Poutsma
2023-03-14 12:35:14 +01:00
parent c3ce847871
commit 1f8e9f5c55
2 changed files with 13 additions and 1 deletions

View File

@@ -624,7 +624,11 @@ public final class ContentDisposition {
char c = filename.charAt(i);
if (filename.charAt(i) == '\\' && i + 1 < length) {
i++;
sb.append(filename.charAt(i));
char next = filename.charAt(i);
if (next != '"' && next != '\\') {
sb.append(c);
}
sb.append(next);
}
else {
sb.append(c);