Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

HttpError's MessageDetail send to client despite IncludeErrorDetailPolicy

$
0
0

MessageDetail value is send with response despite IncludeErrorDetailPolicy value set to Never

Repro steps:
1. In OWIN Startup set

config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Never;


2. create webapi method with the following code

HttpError httpError = new HttpError{Message = "error message", MessageDetail = "error details"};
var errorResponse = Request.CreateErrorResponse(HttpStatusCode.BadRequest, httpError);
throw new HttpResponseException(errorResponse);


Actual result contains both Message and MessageDetail, expected should contain only Message as described here https://msdn.microsoft.com/en-us/library/system.web.http.httperror.messagedetail%28v=vs.118%29.aspx 

Isn't it wrong?


Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

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