spec for middleware