Include quoted printable filename in ContentDisposition::toString
This commit ensures the ContentDisposition class prints the filename in both in the regular filename parameter and the extended filename* parameter (RFC 5987). Quoted printable (RFC 2047) is used to encode any non-ASCII characters in the regular filename parameter. Closes gh-29861
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -249,7 +249,9 @@ class ContentDispositionTests {
|
||||
.name("name")
|
||||
.filename("中文.txt", StandardCharsets.UTF_8)
|
||||
.build().toString())
|
||||
.isEqualTo("form-data; name=\"name\"; filename*=UTF-8''%E4%B8%AD%E6%96%87.txt");
|
||||
.isEqualTo("form-data; name=\"name\"; " +
|
||||
"filename=\"=?UTF-8?Q?=E4=B8=AD=E6=96=87.txt?=\"; " +
|
||||
"filename*=UTF-8''%E4%B8%AD%E6%96%87.txt");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user