Skip to content

Commit

Permalink
FIX: exception being thrown during redirection (EarlyUrlLocalizer) (#195
Browse files Browse the repository at this point in the history
)
  • Loading branch information
turquoiseowl committed May 17, 2015
1 parent 112ea2a commit a0772bb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/i18n/Concrete/EarlyUrlLocalizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,13 @@ protected static void RedirectWithLanguage(
context.Response.Status = "302 Moved Temporarily";
}
context.Response.RedirectLocation = urlNew;
context.Response.End();

// End the request early: no further processing along the pipeline.
// NB: we did originally use context.Response.End(); here but that causes an
// unnecessary exception to be thrown (https://support.microsoft.com/en-us/kb/312629) (#195)
// NB: the line AFTER this line will execute, so best to return immediately here
// and from caller etc..
context.ApplicationInstance.CompleteRequest();
}

/// <summary>
Expand Down

0 comments on commit a0772bb

Please sign in to comment.