Hi Stuart,
After looking at the
Order of Operations for ServiceStack, adding a
request filter with a Priority of < 0, then that would be invoked before our built-in global request filter.
So, my understanding (and I've not proven this!) is that if you create a class which inherits from ServiceStack's RequestFilterAttribute, and set the Priority property to something < 0 - then any service classes decorated with an attribute of your custom class will cause that service to execute your custom request filter before our global request filter.
But - that would mean you'd have to decorate every service with the attribute - if you are wanting to apply this to our built-in services then that's not ideal - but if it's for your own custom service classes you've added, then it's not a problem.
If you do need a way of executing your custom request filter for our built-in classes before our global filter (without adding the attribute to our classes), then we'd have to build in some functionality to make that possible. That should be fairly simple - we just expose a list of delegate functions you can add to, and our global filter invokes those in order before anything else goes on in our global request filter.
There are also prerequest filters in ServiceStack - but those get invoked before the DTO is deserialised, and before our global request filter - that may or may not suit your needs.
I've added
DEV-6678 to look into plugins adding request filters which are executed before our global filters.
Mike