_httpApp, it successfully passes the control down to the next middleware. As far as I understand, a Middleware is just a function that takes an App.Default and returns an App.Default. And an App.Default is just an Effect that succeeds with a ServerResponse: Effect.Effect<R | ServerRequest.ServerRequest, E, ServerResponse>.Effect.succeed(Http.response.empty({ status: 401 })) would not be a correct App.Default. The compiler is happy, it just doesn't work at runtime.