RequestFilter typedef

RequestFilter = Future Function(HttpConnect connect, Future chain(HttpConnect conn))

The request filter. It is used with the filterMapping parameter of StreamServer.

  • chain - the callback to resume the request handling. If there is another filter (including the default handling, such as URI mapping and resource loading), it will be invoked when you call back chain. If you'd like to skip the handling (e.g., redirect to another page), you don't have to call back chain.

Before calling back chain, you can proxy the request and/or response, such as writing the the response to a string buffer.

Implementation

typedef Future RequestFilter(HttpConnect connect, Future chain(HttpConnect conn));