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

Created Issue: [CORS] Trace level of preflight request rejected should be Warning instead of Information. [965]

$
0
0
__Issue__
Today if a preflight is rejected. 400 is returned and following is the tracing output
```
iisexpress.exe Information: 0 : [2013-04-02T23:39:57.9893186Z] Level=Info, Kind=Begin, Category='System.Web.Http.Cors', Id=00000000-0000-0000-0000-000000000000, Operation=CorsEngine.EvaluatePolicy
iisexpress.exe Information: 0 : [2013-04-02T23:39:57.9993268Z] Level=Info, Kind=End, Category='System.Web.Http.Cors', Id=00000000-0000-0000-0000-000000000000, Message='CorsResult returned: 'IsValid: False, AllowCredentials: False, PreflightMaxAge: null, AllowOrigin: http://localhost:28793, AllowExposedHeaders: {}, AllowHeaders: {}, AllowMethods: {GET}, ErrorMessages: {The collection of headers 'dataserviceversion,accept,origin' is not allowed.}'', Operation=CorsEngine.EvaluatePolicy
```
Note that the level is Information. Though it is a customer failure, it is still worth to bump the level to warning so user can filter the trace records but still keep failed CORS request records.

Contrast with how we dealing with 404 in tracing. We set the level to warning when controller selection is failed.
```
iisexpress.exe Warning: 0 : Message='UserMessage='No HTTP resource was found that matches the request URI 'http://localhost:27032/api/values'.', MessageDetail='No type was found that matches the controller named 'values'.'', Operation=DefaultHttpControllerSelector.SelectController, Status=404 (NotFound), Exception=System.Web.Http.HttpResponseException: Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details.
at System.Web.Http.Dispatcher.DefaultHttpControllerSelector.SelectController(HttpRequestMessage request)
at System.Web.Http.Tracing.Tracers.HttpControllerSelectorTracer.<>c__DisplayClass3.<System.Web.Http.Dispatcher.IHttpControllerSelector.SelectController>b__1()
at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEnd(ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Action execute, Action`1 endTrace, Action`1 errorTrace)
```

In a simplified tracing model:
When the http status are 1xx to 3xx: the level should be information
When the http status are 4xx, the issues are caused by customer, level should be warning
When the http status are 5xx, the issues are server, level should be error

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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