From 78517cac347d7b892fd5fc0748b02f0220168577 Mon Sep 17 00:00:00 2001 From: rudolf Date: Wed, 23 Mar 2005 11:46:07 +0000 Subject: =?UTF-8?q?URLEncoding=20f=C3=BCr=20ParamAuth=20Methode=20wurde=20?= =?UTF-8?q?hinzugef=C3=BCgt=20(Methode:=20appendQueryString)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@274 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../egovernment/moa/id/proxy/DefaultConnectionBuilder.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'id.server/src/at/gv/egovernment') 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; -- cgit v1.2.3