-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a simple redirect result that will use 303 and show that even w…
…hen using 303 - chrome still fails. now you can see both options are effed
- Loading branch information
Showing
7 changed files
with
88 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Web; | ||
using System.Web.UI; | ||
using System.Web.Mvc; | ||
using System.Web.Routing; | ||
|
||
namespace ChromePRG | ||
{ | ||
/// <summary> | ||
/// use this to redirect with 303 result | ||
/// return this when redirecting after a post request | ||
/// </summary> | ||
public class SeeOtherRedirectResult : ActionResult | ||
{ | ||
public string Url { get; set; } | ||
|
||
public SeeOtherRedirectResult(string url) | ||
{ | ||
this.Url = url; | ||
} | ||
|
||
public SeeOtherRedirectResult(RequestContext context, string actionName, string controllerName) | ||
{ | ||
UrlHelper urlHelper = new UrlHelper(context); | ||
string url = urlHelper.Action(actionName, controllerName); | ||
|
||
this.Url = url; | ||
} | ||
|
||
public SeeOtherRedirectResult(RequestContext context, string actionName, string controllerName, object values) | ||
{ | ||
UrlHelper urlHelper = new UrlHelper(context); | ||
string url = urlHelper.Action(actionName, controllerName, values); | ||
|
||
this.Url = url; | ||
} | ||
|
||
public SeeOtherRedirectResult(RequestContext context, string actionName, string controllerName, RouteValueDictionary values) | ||
{ | ||
UrlHelper urlHelper = new UrlHelper(context); | ||
string url = urlHelper.Action(actionName, controllerName, values); | ||
|
||
this.Url = url; | ||
} | ||
|
||
public override void ExecuteResult(ControllerContext context) | ||
{ | ||
if (context == null) | ||
{ | ||
throw new ArgumentNullException("context"); | ||
} | ||
context.HttpContext.Response.StatusCode = 303; | ||
context.HttpContext.Response.RedirectLocation = Url; | ||
context.HttpContext.Response.End(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters