Need to update this. I'd include a comment about how it needs to run before any middlewares that could alter content length, like compression stuff.