Skip to content

Commit a0772bb

Browse files
committed
FIX: exception being thrown during redirection (EarlyUrlLocalizer) (#195)
1 parent 112ea2a commit a0772bb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: src/i18n/Concrete/EarlyUrlLocalizer.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,13 @@ protected static void RedirectWithLanguage(
189189
context.Response.Status = "302 Moved Temporarily";
190190
}
191191
context.Response.RedirectLocation = urlNew;
192-
context.Response.End();
192+
193+
// End the request early: no further processing along the pipeline.
194+
// NB: we did originally use context.Response.End(); here but that causes an
195+
// unnecessary exception to be thrown (https://support.microsoft.com/en-us/kb/312629) (#195)
196+
// NB: the line AFTER this line will execute, so best to return immediately here
197+
// and from caller etc..
198+
context.ApplicationInstance.CompleteRequest();
193199
}
194200

195201
/// <summary>

0 commit comments

Comments
 (0)