private function extractStreamVersionFromLastResponse(string $streamUrl)
    {
        $locationHeaders = $this->getLastResponse()->getHeader('Location');

        if (
            !empty($locationHeaders[0])
            && 0 === strpos($locationHeaders[0], $streamUrl)
        ) {
            $version = substr($locationHeaders[0], strlen($streamUrl));

            return (int)trim($version, '/');
        }

        return false;
    }