-
Bug
-
Resolution: Done
-
Minor
-
3.6.0.Final, 4.0.0.Beta4
-
None
A change was introduced for RESTEASY-1779 to encode non-US-ASCII filenames per RFC 5987, but the fix was incorrect/incomplete. The filename is encoded using URLEncoder, which specifically replaces a space character (" ") with a plus sign ("+"). However, RFC 5987 3.2.1 specifies that any character not included in their attr-char set (defined in the same section should have their byte representation percent encoded per RFC 3986 section 2.1.
Spaces are not included in the attr-char set defined in RFC 5987 3.2.1, so spaces should be percent-encoded per RFC 3986 as "%20":
https://tools.ietf.org/html/rfc3986#section-2.1
This bug results in some clients being unable to read a filename. For example, prior to this change, "Test file.pdf" would be show in the content-disposition header as:
filename="Test file.pdf".
After the change, it shows incorrectly as:
filename*=utf-8''Test+File.pdf
The correct encoding should be:
filename*=utf-8''Test%20file.pdf
- is related to
-
RESTEASY-1214 WildFly breaks utf-8 encoded strings in Content-Disposition header
- Open