Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit c201b8a

Browse files
committed
Wrap Branch in try finally
1 parent 53be622 commit c201b8a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Microsoft.AspNet.Http.Abstractions/Extensions/MapMiddleware.cs

+9-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,15 @@ public async Task Invoke(HttpContext context)
5757
context.Request.PathBase = pathBase + _options.PathMatch;
5858
context.Request.Path = remainingPath;
5959

60-
await _options.Branch(context);
61-
62-
context.Request.PathBase = pathBase;
63-
context.Request.Path = path;
60+
try
61+
{
62+
await _options.Branch(context);
63+
}
64+
finally
65+
{
66+
context.Request.PathBase = pathBase;
67+
context.Request.Path = path;
68+
}
6469
}
6570
else
6671
{

0 commit comments

Comments
 (0)