+2007-11-02 Miguel de Icaza <miguel@novell.com>
+
+ * Uri.cs (AppendQueryAndFragment): Unescape the query with
+ excludeSpecial = false. See bug #320614.
+
+ Unlike the patch on that bug, this only unescapes the query and
+ not the Path. This keeps our existing tests working.
+
2007-09-29 Miguel de Icaza <miguel@novell.com>
* Uri.cs (ToString, MakeRelativeUri): refactor some code in
void AppendQueryAndFragment (ref string result)
{
if (query.Length > 0) {
- string q = query [0] == '?' ? '?' + Unescape (query.Substring (1), true) : Unescape (query, true);
+ string q = query [0] == '?' ? '?' + Unescape (query.Substring (1), false) : Unescape (query, false);
result += q;
}
if (fragment.Length > 0)
AssertEquals ("#9d", "file:///foo%25bar", uri.ToString ());
}
}
+
+ // Novell Bugzilla #320614
+ [Test]
+ public void QueryEscape ()
+ {
+ Uri u1 = new Uri("http://localhost:8080/test.aspx?ReturnUrl=%2fSearchDoc%2fSearcher.aspx");
+ Uri u2 = new Uri("http://localhost:8080/test.aspx?ReturnUrl=%252fSearchDoc%252fSearcher.aspx");
+
+ AssertEquals ("QE1", u1.ToString (), "http://localhost:8080/test.aspx?ReturnUrl=/SearchDoc/Searcher.aspx");
+ AssertEquals ("QE2", u2.ToString (), "http://localhost:8080/test.aspx?ReturnUrl=%2fSearchDoc%2fSearcher.aspx");
+ }
[Test]
public void UnixPath () {