#Starlette (and thus #FastAPI) does self.render() in Response.init() to populate self.body, meaning that for example a JSONResponse will always instantly render its JSON to bytes as soon as it's constructed, not lazily when it's actually about to be sent.
This becomes a bit of an issue when you'd like to modify the original data in a middleware, because you basically have to re-parse the bytes into a Python object, then render them again.
There's also no way to access the original object.
It is literally one (1) day after having set up dual-boot Linux on the laptop that ran Windows for years, and now the other laptop, that has been my Linux machine for months, does no longer react to its Control key being pressed (and yes, it has only one).
Why does always something have to break?
I've also found out that apparently I have to decide between either being able to share my screen under Sway or have audio without stuttering.
Also, #FastAPI / #Starlette middleware should totally have a way to get a reference to the function that handled the request. Make it a property on the Response object.
(Yes, I will open an issue about that and maybe even write a PR, but not tonight. Tonight there's only energy for tootin'.)