Wrap Branch in try finally

This commit is contained in:
Brennan 2015-12-14 13:22:42 -08:00
parent 59b32934e3
commit c41be75796
1 changed files with 9 additions and 4 deletions

View File

@ -57,11 +57,16 @@ namespace Microsoft.AspNet.Builder.Extensions
context.Request.PathBase = pathBase + _options.PathMatch; context.Request.PathBase = pathBase + _options.PathMatch;
context.Request.Path = remainingPath; context.Request.Path = remainingPath;
try
{
await _options.Branch(context); await _options.Branch(context);
}
finally
{
context.Request.PathBase = pathBase; context.Request.PathBase = pathBase;
context.Request.Path = path; context.Request.Path = path;
} }
}
else else
{ {
await _next(context); await _next(context);