You can set the result property of the HttpActionContext :
public override void OnActionExecuting(HttpActionContext actionContext) { if (checkVerified()) { actionContext.Response = new HttpResponseMessage(HttpStatusCode.Unauthorized); } }
you might just throw away:
throw new HttpResponseException(HttpStatusCode.Unauthorized);
but I did not check it.
veblock
source share