You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.
The issue may be reproduced with that project with the following steps:
Run the application, using either dnx web or the IIS Express option from Visual Studio
Load the page in the browser
Click the button to send a request to the page that will raise an exception
Send further GET requests to the page
The symptom is that, after having raised the exception, the PathBase of the request will be intermittently doubled up, resulting in broken links. Having stepped through the MapMiddleware's Invoke method, I can see that the context.Request.PathBase is already set to /aspnet-map-quirk coming into the middleware, even though the request URI shows properly as /aspnet-map-quirk when inspecting the Features collection on the HttpContext. I am not sure if this is due to faulty context recycling on part of Kestrel or not, as I don't know much about Kestrel -- perhaps @davidfowl or @DamianEdwards would have something to say here.
Here is a sample project:
https://github.com/tuespetre/aspnet-map-quirk
The issue may be reproduced with that project with the following steps:
dnx web
or the IIS Express option from Visual StudioThe symptom is that, after having raised the exception, the
PathBase
of the request will be intermittently doubled up, resulting in broken links. Having stepped through theMapMiddleware
'sInvoke
method, I can see that thecontext.Request.PathBase
is already set to/aspnet-map-quirk
coming into the middleware, even though the request URI shows properly as/aspnet-map-quirk
when inspecting theFeatures
collection on theHttpContext.
I am not sure if this is due to faulty context recycling on part of Kestrel or not, as I don't know much about Kestrel -- perhaps @davidfowl or @DamianEdwards would have something to say here.The workaround is to uncomment the following line:
https://github.com/tuespetre/aspnet-map-quirk/blob/master/AspNetMapQuirk/Startup.cs#L21
This prevents the exception from propagating out of the branch and subsequently causing the issue with the doubled-up
PathBase
.A
try ... finally
block withinMapMiddleware
'sInvoke
method would ultimately guard against this issue.The text was updated successfully, but these errors were encountered: