Thing is that get_body works correctly but set_content_length doesn't. The later uses the body in resp.body. I thought about changing its signature and adding an optional body parameter but then I thought other helpers, hooks and calls might be operating on a non-update body, which may lead to more bugs like this one.