'Checks to see if an there is an existing Header directive that
contains the string header_substring.
:param ssl_vhost: vhost to check
:type vhost: :class:`~certbot_apache.obj.VirtualHost`
:param header_substring: string that uniquely identifies a header.
e.g: Strict-Transport-Security, Upgrade-Insecure-Requests.
:type str
:returns: boolean
:rtype: (bool)
:raises errors.PluginEnhancementAlreadyPresent When header
header_substring exists'

def _verify_no_matching_http_header(self, ssl_vhost, header_substring):

    header_path = self.parser.find_dir('Header', None, start=ssl_vhost.path)
    if header_path:
        pat = ('(?:[    "]|^)(%s)(?:[    "]|$)' % header_substring.lower())
        for match in header_path:
            if re.search(pat, self.aug.get(match).lower()):
                raise errors.PluginEnhancementAlreadyPresent(('Existing    %s    header' % header_substring))
