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

Closed Issue: [CORS] There is no easy way to set CORS policy for an HTTP batching endpoint only. [1006]

$
0
0
To make the scenario of integrating the recently added HTTP batching function with CORS work, following setting up is required.

'''
var config = GlobalConfiguration.Configuration;

config.Routes.MapHttpBatchRoute(
"batch",
"api/batch",
new DefaultHttpBatchHandler(GlobalConfiguration.DefaultServer));

config.EnableCors(new EnableCorsAttribute());
'''

The problem is the global Cors policy (or default cors policy provider) is required. It is because the batching endpoint doesn't have a real action related so action descriptor is null.

It limit user's choices when they want CORS + HTTP batching scenario but don't want to set a global cors policy. It also indicates that we can't configure CORS on route based HTTP message handler.
Comments: Not a scenario

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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