Bug 1439225 - [GSS](6.4.z) multipart/form-data is not always read with correct encoding
Summary: [GSS](6.4.z) multipart/form-data is not always read with correct encoding
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web
Version: 6.4.14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: CR1
: EAP 6.4.16
Assignee: Jiri Ondrusek
QA Contact: Radim Hatlapatka
URL:
Whiteboard: component:jbossweb
Depends On:
Blocks: eap6416-payload 1440846
TreeView+ depends on / blocked
 
Reported: 2017-04-05 13:00 UTC by Aaron Ogburn
Modified: 2020-08-13 09:01 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-22 09:20:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
bz1439225.diff (1.13 KB, text/plain)
2017-04-05 13:22 UTC, Aaron Ogburn
no flags Details
multipartdemo-0.0.1.war (3.65 KB, application/zip)
2017-04-05 14:06 UTC, Aaron Ogburn
no flags Details
multipartdemo_source.zip (2.46 KB, application/zip)
2017-04-05 14:06 UTC, Aaron Ogburn
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2992431 0 None None None 2017-04-05 13:15:07 UTC

Description Aaron Ogburn 2017-04-05 13:00:18 UTC
Description of problem:

The bug occurs when form data is posted as multipart/form-data and using Servlet 3 API to get posted files. In a servlet, if we set the encoding:

request.setCharacterEncoding("UTF-8");

Then invoke:

request.getParts()

And then invoke:

String text = request.getParameter("sometextfield");

UTF-8 characters in the text have been garbled.

Version-Release number of selected component (if applicable):

7.5.22


How reproducible:

Always

Steps to Reproduce:
1. Deploy multipartdemo-0.0.1.war
2. Access /multipartdemo-0.0.1
3. Submit form with UTF-8 characters

Actual results:

Expected encoding is not properly used for multipart/form-data, resulting in bad characters.

Expected results:

Expected encoding is properly used for multipart/form-data.

Additional info:

Similar to this tomcat issue
https://bz.apache.org/bugzilla/show_bug.cgi?id=54984

Comment 1 Aaron Ogburn 2017-04-05 13:22:55 UTC
Created attachment 1268961 [details]
bz1439225.diff

Here's some changes that addressed the issue on my end

Comment 2 Aaron Ogburn 2017-04-05 14:06:28 UTC
Created attachment 1268988 [details]
multipartdemo-0.0.1.war

Comment 3 Aaron Ogburn 2017-04-05 14:06:57 UTC
Created attachment 1268989 [details]
multipartdemo_source.zip

Comment 9 Michael Cada 2017-06-06 08:11:31 UTC
Verified with EAP 6.4.16.CP.CR1

Comment 10 Petr Penicka 2017-06-22 09:20:06 UTC
Released on June 20 2017 as part of the EAP 6.4.16 maintenance release.


Note You need to log in before you can comment on or make changes to this bug.