Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public void Properties_Invalid ()
}

[Test]
void UrlEscaping_Bug43411 ()
public void UrlEscaping_Bug43411 ()
{
UrlEscaping_TestUrl ($"http://{TestHost}/?example=value%20_value", "#1");
UrlEscaping_TestUrl ($"http://{TestHost}/?query=anna%20%26%20lotte&param2=true", "#2");
Expand All @@ -239,7 +239,10 @@ void UrlEscaping_TestUrl (string url, string messagePrefix)
var request = new HttpRequestMessage (HttpMethod.Get, url);

client.SendAsync (request, HttpCompletionOption.ResponseHeadersRead).Wait ();
Assert.AreEqual (url, request.RequestUri.ToString (), $"{messagePrefix}-1");
// Use AbsoluteUri rather than ToString(): ToString() returns the
// "human-readable" form and unescapes safe characters like %20,
// while AbsoluteUri preserves the canonical percent-encoding.
Assert.AreEqual (url, request.RequestUri.AbsoluteUri, $"{messagePrefix}-1");
Assert.IsNull (failed, $"{messagePrefix}-2");
} finally {
listener.Abort ();
Expand Down