Returning a Response from Middleware to Short Circuit Middleware Chain
How do I correctly return a response from a middleware and short circuit the chain of middlewares?
The above does not work. Requests just keep hanging. If I return the
I'm failing to see why
The above does not work. Requests just keep hanging. If I return the
_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>.I'm failing to see why
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.