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,10 +57,15 @@ 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;
await _options.Branch(context); try
{
context.Request.PathBase = pathBase; await _options.Branch(context);
context.Request.Path = path; }
finally
{
context.Request.PathBase = pathBase;
context.Request.Path = path;
}
} }
else else
{ {