Accessing Response Body in Middleware?

Is there a way to perform logic on the body of a response in a custom middleware? For example if the response contains some value then add that value to a header on the response. I know the BaseHTTPMiddleware class returns a StreamingResponse instead of a regular one so I’m not sure how this would be achieved.