cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1382150 - in /cxf/branches/2.5.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
Date Fri, 07 Sep 2012 20:13:05 GMT
Author: sergeyb
Date: Fri Sep  7 20:13:04 2012
New Revision: 1382150

URL: http://svn.apache.org/viewvc?rev=1382150&view=rev
Log:
Merged revisions 1382142 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

................
  r1382142 | sergeyb | 2012-09-07 21:00:54 +0100 (Fri, 07 Sep 2012) | 9 lines
  
  Merged revisions 1381672 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1381672 | sergeyb | 2012-09-06 17:39:45 +0100 (Thu, 06 Sep 2012) | 1 line
    
    [CXF-4499] Properly encoding not only form keys but values too
  ........
................

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

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1381672
  Merged /cxf/branches/2.6.x-fixes:r1382142

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

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java?rev=1382150&r1=1382149&r2=1382150&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
Fri Sep  7 20:13:04 2012
@@ -138,7 +138,7 @@ public final class FormUtils {
                 String value = entryIterator.next();
                 os.write(entry.getKey().getBytes(enc));
                 os.write('=');
-                String data = encoded ? value : HttpUtils.urlEncode(value);
+                String data = encoded ? value : HttpUtils.urlEncode(value, enc);
                 os.write(data.getBytes(enc));
                 if (entryIterator.hasNext() || it.hasNext()) {
                     os.write('&');

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java?rev=1382150&r1=1382149&r2=1382150&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
Fri Sep  7 20:13:04 2012
@@ -119,10 +119,15 @@ public final class HttpUtils {
     
     public static String urlEncode(String value) {
         
+        return urlEncode(value, "UTF-8");
+    }
+    
+    public static String urlEncode(String value, String enc) {
+        
         try {
-            value = URLEncoder.encode(value, "UTF-8");
+            value = URLEncoder.encode(value, enc);
         } catch (UnsupportedEncodingException ex) {
-            // unlikely to happen
+            throw new RuntimeException(ex);
         }
         
         return value;



Mime
View raw message