+2009-10-23 Alexandre Gomes <alexmipego@gmail.com>
+
+ * WebClient.cs: Fixed GetWebRequest overriding problems, bug:
+ https://bugzilla.novell.com/show_bug.cgi?id=549580
+
2009-10-17 Gonzalo Paniagua Javier <gonzalo@novell.com>
* WebConnectionStream.cs: add 3 missing DoCallback() calls in
WebRequest SetupRequest (Uri uri)
{
- WebRequest request = WebRequest.Create (uri);
+ WebRequest request = GetWebRequest (uri);
#if NET_2_0
if (Proxy != null)
request.Proxy = Proxy;
#endif
WebRequest GetWebRequest (Uri address)
{
- return SetupRequest (address);
+ return WebRequest.Create (address);
}
#if NET_2_0
+2009-10-23 Alexandre Gomes <alexmipego@gmail.com>
+
+ * WebClientTest.cs: Test for GetWebRequest overriding
+ issues
+
2009-07-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
* WebHeaderCollectionTest.cs: test for allowed characters in headers.
}
#endif
+#if NET_2_0
+ [Test]
+ public void GetWebRequestOverriding ()
+ {
+ GetWebRequestOverridingTestClass testObject = new GetWebRequestOverridingTestClass ();
+ testObject.DownloadData ("http://www.mono-project.com");
+
+ Assert.IsTrue (testObject.overridedCodeRan, "Overrided code wasn't called");
+ }
+
+ class GetWebRequestOverridingTestClass : WebClient
+ {
+ internal bool overridedCodeRan = false;
+ protected override WebRequest GetWebRequest(Uri address)
+ {
+ overridedCodeRan = true;
+ return base.GetWebRequest (address);
+ }
+ }
+#endif
+
static byte [] EchoRequestHandler (Socket socket)
{
MemoryStream ms = new MemoryStream ();