[REST support] when using POST with x-www-form-urlencoded data aren't decode 
from url encoded
---------------------------------------------------------------------------------------------

                 Key: AXIS2-3748
                 URL: https://issues.apache.org/jira/browse/AXIS2-3748
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.3
         Environment: All
            Reporter: Willy ANTOINE


When the client send REST request through POST, the data are urlencoded. 
In this case, the org.apache.axis2.builder.XFormURLEncodedBuilder class takes 
value from the request's inputstream in the extractParametersFromRequest 
method, and put them into the parameterMap as is. 
This problem doesn't appears in GET method because the application server is 
doing the job when calling request.getParameter() 

So the data must be decoded before to be put in the parameterMap.
The following code
                        for (int i = 0; i < parts.length; i++) {
                            int separator = parts[i].indexOf("=");
                            parameterMap.put(parts[i].substring(0, 
separator),parts[i].substring(separator +
                                        1));
                        }
Must be changed to
                        for (int i = 0; i < parts.length; i++) {
                            int separator = parts[i].indexOf("=");
                            parameterMap.put(parts[i].substring(0, separator),
                                URLDecoder.decode(parts[i].substring(separator +
                                        1), charsetEncoding));
                        }

Best regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to