protected function convertUrl($url, $https)
    {
        $scheme = ($https) ? 'https' : 'http';
        $parser = new Url($url);
        $parser->setScheme($scheme);

        return $parser->__toString();
    }