ソースを参照

2010-05-25 Atsushi Enomoto <[email protected]>

	* UriTemplate.cs : safe-unescape template parameters.
	  Got bug #573795 site working.


svn path=/trunk/mcs/; revision=157823
Atsushi Eno 15 年 前
コミット
d006ca4a99

+ 5 - 0
mcs/class/System.ServiceModel.Web/System/ChangeLog

@@ -1,3 +1,8 @@
+2010-05-25  Atsushi Enomoto  <[email protected]>
+
+	* UriTemplate.cs : safe-unescape template parameters.
+	  Got bug #573795 site working.
+
 2009-10-23  Atsushi Enomoto  <[email protected]>
 
 	* UriTemplate.cs, UriTemplateMatchException.cs, UriTemplateMatch.cs:

+ 2 - 2
mcs/class/System.ServiceModel.Web/System/UriTemplate.cs

@@ -231,7 +231,7 @@ namespace System
 			m.RequestUri = candidate;
 			var vc = m.BoundVariables;
 
-			string cp = baseAddress.MakeRelativeUri(candidate).ToString ();
+			string cp = Uri.UnescapeDataString (baseAddress.MakeRelativeUri (candidate).ToString ());
 			if (IgnoreTrailingSlash && cp [cp.Length - 1] == '/')
 				cp = cp.Substring (0, cp.Length - 1);
 
@@ -278,7 +278,7 @@ namespace System
 				return m;
 
 
-			string [] parameters = candidate.Query.Substring (1).Split ('&'); // chop first '?'
+			string [] parameters = Uri.UnescapeDataString (candidate.Query.Substring (1)).Split ('&'); // chop first '?'
 			foreach (string parameter in parameters) {
 				string [] pair = parameter.Split ('=');
 				m.QueryParameters.Add (pair [0], pair [1]);