Introducing middleware filters, starting with build 2.0.3100.3

March 22, 2015 10:42 pm Published by Leave your thoughts

In one sentence, now you can forget about “/launcher/workspace/…” prefixes and develop your applications with clean URIs, independently of any launcher.

This is achieved by using so-called middleware filters. Each filter basically represents a delegate added by your application (call Handle.AddFilterToMiddleware). The filters are run one by one, until one of the filters returns a non-null Response object. Last registered filter becomes first to be run in the list (a notion of “overwrite”).

Filters are called only for external HTTP requests (and not internal X.GET calls). If all filters in the list return null, then normal handler execution is performed. One of the uses for these middleware filters can be security checks or some Request object modifications. In case of Polyjuice Launcher, its filter basically wraps the content of application responses that were supposed to be obtained with initial request.

Categorised in:

This post was written by Alexey Moiseenko

Leave a Reply

Your email address will not be published. Required fields are marked *