Bug 1439225

Summary: [GSS](6.4.z) multipart/form-data is not always read with correct encoding
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Aaron Ogburn <aogburn>
Component: WebAssignee: Jiri Ondrusek <jondruse>
Status: CLOSED CURRENTRELEASE QA Contact: Radim Hatlapatka <rhatlapa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.14CC: bmaxwell, jondruse, mcada, rmaucher, rstancel
Target Milestone: CR1   
Target Release: EAP 6.4.16   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: component:jbossweb
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-22 09:20:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1434495, 1440846    
Attachments:
Description Flags
bz1439225.diff
none
multipartdemo-0.0.1.war
none
multipartdemo_source.zip none

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.