I wanted to open this up to start the discussion. I may mock up a quick POC to show what I mean.
Basically, I think we aren't quite using the ASPNET Core middleware in the way that it was originally intended. From my understanding the middleware is meant to inspect and act on requests before they make it to their handler. With the HotPotatoMiddleware, the request is basically hijacked and doesn't make it to the handler. I don't think this is necessarily a problem, especially since it works.
The way I'm thinking of it, we can create a base HotPotatoController to act as a default handler (i.e. it will capture all requests that aren't for /cookies or /results). This controller would have the IProxy injected and will basically have all of the same functionality as HotPotatoMiddleware.
This may also help with using this with TestServer, no matter what design we go with I want to make sure we have better support for that.
I wanted to open this up to start the discussion. I may mock up a quick POC to show what I mean.
Basically, I think we aren't quite using the ASPNET Core middleware in the way that it was originally intended. From my understanding the middleware is meant to inspect and act on requests before they make it to their handler. With the HotPotatoMiddleware, the request is basically hijacked and doesn't make it to the handler. I don't think this is necessarily a problem, especially since it works.
The way I'm thinking of it, we can create a base
HotPotatoController
to act as a default handler (i.e. it will capture all requests that aren't for/cookies
or/results
). This controller would have theIProxy
injected and will basically have all of the same functionality asHotPotatoMiddleware
.This may also help with using this with
TestServer
, no matter what design we go with I want to make sure we have better support for that.