added hook for plugins to register WSGI middlewares