Skip to content

Commit

Permalink
Backport of r142934
Browse files Browse the repository at this point in the history
svn path=/branches/mono-2-6/mcs/; revision=142935
  • Loading branch information
grendello committed Sep 29, 2009
1 parent 69154db commit 43e34e9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions 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
Expand Down
11 changes: 11 additions & 0 deletions mcs/class/System.Web/System.Web/HttpResponse.cs
Expand Up @@ -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
Expand Down

0 comments on commit 43e34e9

Please sign in to comment.