Am 19.12.2015 um 19:05 schrieb Marc Schütz:

Hello vibe.d!

In a web interface, I'd like to add filters that get called before and
after each request. They should take an HTTPServerRequest or
HTTPServerResponse resp., be able to modify headers, and there must be
no limit on how many such filters there are.

@before and @after are not suitable for this task: AFAICS @before is
required to return a value that then gets passed to the handler as an
argument, and @after is only allowed to appear once.

I can kind-of get before-filters by registering wildcard routes that
don't generate a response. Unfortunately, that isn't possible for
after-filters (post processing).

Any ideas?

@after should be allowed to exist any number of times if there is no
bug, did you try it? But @before without a return value would
definitely be nice to have. Even if the long-term future of @before
and @after isn't completely clear, I think it's safe to extend it in
that way.