encode / starlette

The little ASGI framework that shines. 🌟
https://www.starlette.io/
BSD 3-Clause "New" or "Revised" License
10.31k stars 948 forks source link

Fix BackgroundTasks with BaseHTTPMiddleware #2688

Closed adriangb closed 2 months ago

adriangb commented 2 months ago

Alternative to https://github.com/encode/starlette/pull/2176

dmitry-mli commented 2 months ago

FYI, The streaming response used to also do:

            if not isinstance(chunk, (bytes, memoryview)):
                chunk = chunk.encode(self.charset)

It itsn't covered so when it was removed in https://github.com/encode/starlette/pull/2620/files it didn't break

adriangb commented 2 months ago

There is a test already, am I missing something?