public static function fixContentLength(MessageInterface $response): MessageInterface
    {
        $size = $response->getBody()->getSize();
        if ($size !== null) {
            return $response->withHeader('Content-Length', (string) $size);
        }

        return $response->withoutHeader('Content-Length');
    }