[utilities COMMIT] /java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/net/UriSupport.java

noreply at shibboleth.net noreply at shibboleth.net
Wed Sep 25 21:22:41 EDT 2013


Author: putmanb
Date: Wed Sep 25 21:22:41 2013
New Revision: 450

URL: http://svn.shibboleth.net/view/utilities?rev=450&view=rev
Log:
Add some Javadoc warning around UriSupport and java.net.URI's unexpected behavior around query parameters containing '%' characters.

Modified:
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/net/UriSupport.java

Modified: java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/net/UriSupport.java
URL: http://svn.shibboleth.net/view/utilities/java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/net/UriSupport.java?rev=450&r1=449&r2=450&view=diff
==============================================================================
--- java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/net/UriSupport.java (original)
+++ java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/net/UriSupport.java Wed Sep 25 21:22:41 2013
@@ -110,6 +110,14 @@
     /**
      * Sets the query of a URI.
      * 
+     * <p>
+     * <b>WARNING:</b> If the supplied query parameter names and/or values contain '%' characters 
+     * (for example because they are already Base64-encoded), then the approach of using {@link URI} 
+     * instances to work with the URI/URL may not be appropriate.  Per its documentation, the 
+     * {@link URI} constructors always encode '%' characters, which can lead to cases of double-encoding.
+     * For an alternative way of manipulating URL's see {@link UrlBuilder}.
+     * </p>
+     * 
      * @param prototype prototype URI that provides information other than the query
      * @param query query for the new URI
      * 
@@ -126,6 +134,14 @@
 
     /**
      * Sets the query of a URI.
+     * 
+     * <p>
+     * <b>WARNING:</b> If the supplied query parameter names and/or values contain '%' characters 
+     * (for example because they are already Base64-encoded), then the approach of using {@link URI} 
+     * instances to work with the URI/URL may not be appropriate.  Per its documentation, the 
+     * {@link URI} constructors always encode '%' characters, which can lead to cases of double-encoding.
+     * For an alternative way of manipulating URL's see {@link UrlBuilder}.
+     * </p>
      * 
      * @param prototype prototype URI that provides information other than the query
      * @param parameters query parameters for the new URI



More information about the commits mailing list