Permalink
Browse files

Backport of r142934

svn path=/branches/mono-2-6/mcs/; revision=142935
  • Loading branch information...
1 parent 69154db commit 43e34e922109adb8cbf6aaaf1dbc1dce3350f88f @grendello grendello committed Sep 29, 2009
Showing with 18 additions and 0 deletions.
  1. +7 −0 mcs/class/System.Web/System.Web/ChangeLog
  2. +11 −0 mcs/class/System.Web/System.Web/HttpResponse.cs
View
7 mcs/class/System.Web/System.Web/ChangeLog
@@ -1,3 +1,10 @@
+2009-09-29 Marek Habersack <mhabersack@novell.com>
+
+ * HttpResponse.cs: use full url in redirect if
+ UseFullyQualifiedRedirectUrl is set to true in httpRuntime
+ configuration section. Patch from Brett Kiefer
+ <brett@fogcreek.com>, thanks! Fixes bug #542846
+
2009-09-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
* HttpContext.cs: try to load App_GlobalResouces.dll if it has not
View
11 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

0 comments on commit 43e34e9

Please sign in to comment.