Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Closed Issue: HttpRoute.GetVirtualPath shouldn't fail just becase the route data property is missing [669]

$
0
0
GetVirtualPath on HttpRoute currently has this code:
IHttpRouteData routeData = request.GetRouteData();
if (routeData == null)
{
return null;
}

That's wrong. In MVC we don't require route data to generate a link. Instead, we just treat it as if the route data had an empty collection.

This behavior is particularly problematic for MediaTypeFormatters that need to serialize errors and use GetVirtualPath in their implementation. If routing itself fails, no route data property will be set. When the media type formatter is asked to serialize the resulting error, it won't be able to use GetVirtualPath.
Comments: verified

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>