[Mono-bugs] [Bug 75135][Nor] New - Web client redirect fails when
using proxy on web request
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Fri Jun 3 01:41:02 EDT 2005
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by mlasky at novell.com.
http://bugzilla.ximian.com/show_bug.cgi?id=75135
--- shadow/75135 2005-06-03 01:41:02.000000000 -0400
+++ shadow/75135.tmp.19538 2005-06-03 01:41:02.000000000 -0400
@@ -0,0 +1,93 @@
+Bug#: 75135
+Product: Mono: Class Libraries
+Version: 1.1
+OS: SLES 9
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.Web
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: mlasky at novell.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc: cgaisford at novell.com,jpallen at novell.com
+Summary: Web client redirect fails when using proxy on web request
+
+Please fill in this template when reporting a bug, unless you know what
+you are doing.
+Description of Problem:
+When making an http web request to an http web server, the web request
+fails if the request is redirected (302) and the request was sent via a
+proxy.
+
+Steps to reproduce the problem:
+1. Run the code below. The hard coded address in the WebRequest is valid
+and you can use it to reproduce the problem.
+2. Set up an HTTP web proxy (Apache or Squid is easy) and change the
+WebProxy constructor to point at your web proxy.
+3. Run the code.
+
+using System;
+using System.Net;
+using System.Web;
+
+namespace Test
+{
+ /// <summary>
+ /// Summary description for Test.
+ /// </summary>
+ public class Test
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ static void Main(string[] args)
+ {
+ CertPolicy cp = new CertPolicy();
+
+ HttpWebRequest webRequest = (HttpWebRequest)
+WebRequest.Create( "https://193.97.125.1/simias10/DomainService.asmx" );
+ webRequest.Proxy = new WebProxy
+( "http://137.65.56.81:8080" );
+ try
+ {
+ HttpWebResponse response =
+webRequest.GetResponse() as HttpWebResponse;
+ Console.WriteLine( "Redirected url =
+{0}", response.ResponseUri );
+ }
+ catch( WebException ex )
+ {
+ Console.WriteLine( "Web exception {0}",
+ex.Message );
+ HttpWebResponse exResponse = ex.Response
+as HttpWebResponse;
+ if ( exResponse.StatusCode ==
+HttpStatusCode.Unauthorized )
+ {
+ Console.WriteLine( "Redirected
+url = {0}", exResponse.ResponseUri );
+ }
+ }
+ }
+ }
+}
+
+
+Actual Results:
+Receives a WebException: SendFailure with a nested exception of
+NullReferenceException.
+
+Expected Results:
+Expect to get the redirected URI.
+
+
+How often does this happen?
+Every time if the proxy is specified in the WebRequest. If the proxy is
+removed from the WebRequest, it completes successfully.
+
+Additional Information:
More information about the mono-bugs
mailing list