1 2 3 4 5 6 7
def modify(chunks): for chunk in chunks: yield chunk.replace(b"foo", b"bar") def responseheaders(flow): flow.response.stream = modify