diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog index 01e1ec7aba6cf..a21b156e0ee8a 100644 --- a/mcs/class/System.Web/System.Web/ChangeLog +++ b/mcs/class/System.Web/System.Web/ChangeLog @@ -1,3 +1,10 @@ +2009-09-29 Marek Habersack + + * HttpResponse.cs: use full url in redirect if + UseFullyQualifiedRedirectUrl is set to true in httpRuntime + configuration section. Patch from Brett Kiefer + , thanks! Fixes bug #542846 + 2009-09-29 Gonzalo Paniagua Javier * HttpContext.cs: try to load App_GlobalResouces.dll if it has not diff --git a/mcs/class/System.Web/System.Web/HttpResponse.cs b/mcs/class/System.Web/System.Web/HttpResponse.cs index 7ed591b59ee7c..a5e1ad8f9c8e4 100644 --- a/mcs/class/System.Web/System.Web/HttpResponse.cs +++ b/mcs/class/System.Web/System.Web/HttpResponse.cs @@ -881,6 +881,17 @@ public void Redirect (string url, bool endResponse) StatusCode = 302; url = ApplyAppPathModifier (url); +#if NET_2_0 + HttpRuntimeSection config = WebConfigurationManager.GetWebApplicationSection ("system.web/httpRuntime") as HttpRuntimeSection; + if (config != null && config.UseFullyQualifiedRedirectUrl) { + var ub = new UriBuilder (context.Request.Url); + ub.Fragment = null; + ub.Password = null; + ub.Query = null; + ub.UserName = null; + url = ub.Uri.ToString (); + } +#endif redirect_location = url; // Text for browsers that can't handle location header