From: jprocter Date: Tue, 30 Aug 2011 10:21:28 +0000 (+0100) Subject: JAL-715 need to URLencode constant values when serializing them to ensure URL string... X-Git-Tag: Release_2_7~72 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3ca9cf3aa73c3f36403de4b3a5353450970c183e;p=jalview.git JAL-715 need to URLencode constant values when serializing them to ensure URL string is valid --- diff --git a/src/jalview/ws/rest/params/JobConstant.java b/src/jalview/ws/rest/params/JobConstant.java index fddfd3b..64bb45f 100644 --- a/src/jalview/ws/rest/params/JobConstant.java +++ b/src/jalview/ws/rest/params/JobConstant.java @@ -6,6 +6,7 @@ import jalview.ws.rest.NoValidInputDataException; import jalview.ws.rest.RestJob; import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; @@ -49,7 +50,13 @@ public class JobConstant extends InputType if (value!=null && value.length()>0) { - prm.add(value); + try { + prm.add(URLEncoder.encode(value,"UTF-8")); + } catch (UnsupportedEncodingException ex) + { + throw new Error("Couldn't encode '"+value+"' as UTF-8.",ex); + + } } return prm; }