Support escape character in ContentDisposition
Closes gh-23077
This commit is contained in:
@@ -79,6 +79,14 @@ public class ContentDispositionTests {
|
||||
.filename("中文.txt", StandardCharsets.UTF_8).build(), disposition);
|
||||
}
|
||||
|
||||
@Test // gh-23077
|
||||
public void parseWithEscapedQuote() {
|
||||
ContentDisposition disposition = ContentDisposition.parse(
|
||||
"form-data; name=\"file\"; filename=\"\\\"The Twilight Zone\\\".txt\"; size=123");
|
||||
assertEquals(ContentDisposition.builder("form-data").name("file")
|
||||
.filename("\\\"The Twilight Zone\\\".txt").size(123L).build(), disposition);
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void parseEmpty() {
|
||||
ContentDisposition.parse("");
|
||||
|
||||
Reference in New Issue
Block a user