Skip to content

Commit 662890a

Browse files
committed
Support additional special character escaping in the url query string
1 parent b23ffae commit 662890a

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

Rally.RestApi/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.0.13.0")]
35-
[assembly: AssemblyFileVersion("1.0.13.0")]
34+
[assembly: AssemblyVersion("1.0.14.0")]
35+
[assembly: AssemblyFileVersion("1.0.14.0")]
3636

3737
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Rally.RestApi.Test")]

Rally.RestApi/Query.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Linq;
44
using System.Text.RegularExpressions;
55
using System.Web;
6+
using System.Diagnostics;
67

78
namespace Rally.RestApi
89
{
@@ -234,7 +235,8 @@ public string QueryClause
234235
return queryClause;
235236
}
236237
const char quote = '"';
237-
var outValue = (Value.Contains(" ") ? quote + Value + quote : Value).Replace("&","%26");
238+
// Quote the value
239+
var outValue = quote + Value.Replace("%", "%25").Replace("&", "%26").Replace("#", "%23").Replace("\"", "%22").Replace("+", "%2B") + quote;
238240
return string.Format("({0} {1} {2})", Attribute, GetOperator(QueryOperator), outValue);
239241
}
240242

0 commit comments

Comments
 (0)