You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am a Starlette maintainer. We are trying to get folks moved away from BaseHTTPMiddleware because it has several unfixable bugs and performance issues. One of the highest impact ways of doing this is going to be porting downstream packages (like this one) to pure ASGI middleware.
Taking a look at the package, it seems like it would be pretty straightforward to port the middleware itself to a pure ASGI middleware. The part that is going to be tricky is that the API sends Request/Response objects into user's functions. That part can't really be changed. What I'd proposed is creating a Request object with a placeholder receive that raises an error if called (i.e. you can't access the Request body) and maybe a Response that can't be run (i.e. Response.__call__ raises an exception).
To be clear I am volunteering my time to do this, but I will need review, some discussion about the above issues, etc.
Hey @adriangb, sounds good. But beware my lack of knowledge regarding Python ASGI. Also check out this pull request: #139. I think @Kludex has already (partially?) worked on replacing the middleware
Hi, I am a Starlette maintainer. We are trying to get folks moved away from BaseHTTPMiddleware because it has several unfixable bugs and performance issues. One of the highest impact ways of doing this is going to be porting downstream packages (like this one) to pure ASGI middleware.
Taking a look at the package, it seems like it would be pretty straightforward to port the middleware itself to a pure ASGI middleware. The part that is going to be tricky is that the API sends Request/Response objects into user's functions. That part can't really be changed. What I'd proposed is creating a
Request
object with a placeholderreceive
that raises an error if called (i.e. you can't access the Request body) and maybe aResponse
that can't be run (i.e.Response.__call__
raises an exception).To be clear I am volunteering my time to do this, but I will need review, some discussion about the above issues, etc.
Does this sound reasonable @trallnag?
The text was updated successfully, but these errors were encountered: