You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2009/12/10 20:25:06 UTC

svn commit: r889377 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java

Author: sergeyb
Date: Thu Dec 10 19:25:06 2009
New Revision: 889377

URL: http://svn.apache.org/viewvc?rev=889377&view=rev
Log:
Merged revisions 889348 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r889348 | sergeyb | 2009-12-10 17:59:34 +0000 (Thu, 10 Dec 2009) | 1 line
  
  Decoding form parameter names too
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 19:25:06 2009
@@ -1 +1 @@
-/cxf/trunk:887317,888400-888401,889344
+/cxf/trunk:887317,888400-888401,889344,889348

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java?rev=889377&r1=889376&r2=889377&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java Thu Dec 10 19:25:06 2009
@@ -77,22 +77,22 @@
             for (String part : parts) {
                 String[] keyValue = part.split("=");
                 // Change to add blank string if key but not value is specified
+                String name = HttpUtils.urlDecode(keyValue[0]);
                 if (keyValue.length == 2) {
                     if (decode) {
-                        params.add(keyValue[0], 
-                            HttpUtils.urlDecode(keyValue[1]));
+                        params.add(name, HttpUtils.urlDecode(keyValue[1]));
                     } else {
-                        params.add(keyValue[0], keyValue[1]);
+                        params.add(name, keyValue[1]);
                     }
                 } else {
-                    params.add(keyValue[0], "");
+                    params.add(name, "");
                 }
             }
         } else if (request != null) {
             for (Enumeration en = request.getParameterNames(); en.hasMoreElements();) {
                 String paramName = en.nextElement().toString();
                 String[] values = request.getParameterValues(paramName);
-                params.put(paramName, Arrays.asList(values));
+                params.put(HttpUtils.urlDecode(paramName), Arrays.asList(values));
             }
         }
     }
@@ -110,7 +110,8 @@
             String name = cd.getParameter("name").replace("\"", "").replace("'", "");
             try {
                 String value = IOUtils.toString(a.getDataHandler().getInputStream());
-                params.add(name, decode ? HttpUtils.urlDecode(value) : value);
+                params.add(HttpUtils.urlDecode(name),
+                           decode ? HttpUtils.urlDecode(value) : value);
             } catch (IOException ex) {
                 throw new WebApplicationException(415);
             }