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

Edited Unassigned: [WebApiOnKatana]Indicate Soft 404 Not Found response when CORS is enabled and route doesn't match [986]

$
0
0
In SelfHost/Katana, route matching normally happens at HttpRoutingDispatcher, but when CORS is enabled, we add a message handler where we do route matching for pre-flight requests. Since this message handler runs before the HttpRoutingDispatcher, we need to make sure that we set the property on the response to indicate _Soft_ 404 Not Found response when a route doesn't match.

This bug is related to issue # 985. Once its fixed, we need to add the property "MS_NoRouteMatched" in the 404 Not Found response to indicate that its a soft response.

AttributeBasedPolicyProviderFactory.cs:
```
private static HttpActionDescriptor SelectAction(HttpRequestMessage request)
{
HttpConfiguration config = request.GetConfiguration();
if (config == null)
{
throw new InvalidOperationException(SRResources.NoConfiguration);
}

IHttpRouteData routeData = request.GetRouteData();
if (routeData == null)
{
routeData = config.Routes.GetRouteData(request);
if (routeData == null)
{
throw new InvalidOperationException(SRResources.NoRouteData);
}
request.Properties[HttpPropertyKeys.HttpRouteDataKey] = routeData;
}
```

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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