Configure middleware with a block

Allows arbitrary transformation of `rack` environment