diff options
-rw-r--r-- | id.server/src/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java b/id.server/src/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java index 7807955c2..5ded393d1 100644 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java +++ b/id.server/src/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java @@ -1,8 +1,10 @@ package at.gv.egovernment.moa.id.proxy; import java.io.IOException; +import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.URL; +import java.net.URLEncoder; import java.util.Iterator; import java.util.Map; @@ -89,9 +91,15 @@ public class DefaultConnectionBuilder implements ConnectionBuilder { */ private String appendQueryString(String requestedURL, Map parameters) { String newURL = requestedURL; + String paramValue =""; + String paramName =""; for (Iterator iter = parameters.keySet().iterator(); iter.hasNext();) { - String paramName = (String)iter.next(); - String paramValue = (String)parameters.get(paramName); + try { + paramName = URLEncoder.encode((String) iter.next(), "UTF-8"); + paramValue = URLEncoder.encode((String) parameters.get(paramName), "UTF-8"); + } catch (UnsupportedEncodingException e) { + //UTF-8 should be supported + } String paramString = paramName + "=" + paramValue; if (newURL.indexOf("?") < 0) newURL = newURL + "?" + paramString; |