stefanprodan / WebApiThrottle

ASP.NET Web API rate limiter for IIS and Owin hosting
MIT License
1.28k stars 274 forks source link

CreateErrorResponse instead of CreateResponse #94

Open vladopandzic opened 7 years ago

vladopandzic commented 7 years ago

At the end of message handler you call Request.CreateResponse. Is it possible that you actually use Request.CreateErrorResponse, or make it at least configurable. This is important because I use other message handlers made by myself and they treat your response message as actual data (instead of threating them as errors). I know this is small change in code but probably breaking one, but making strategy about returning response configurable would be great

jlkoneczny commented 7 years ago

You can override that method and use CreateErrorResponse instead. Both CreateResponse and CreateErrorResponse have a return type of HttpResponseMessage.

jboarman commented 6 years ago

@vladop Are there specific side effects that you are expecting CreateErrorResponse to provide? What are some differences in the HttpResponseMessage that you expect to see?