By its nature, this is apparently the wrong place to implement it. As you noted, message handlers work in all requests and responses. If you are dependent on an attribute, this will naturally be a filter. Therefore, I suggest you follow this route.
In fact, in the handler, you cannot assume that you are going to ApiController or to an action. Handlers can be used equally on clients.
source share