Skip to content
  • Patrick Steinhardt's avatar
    urlmatch: allow globbing for the URL host part · a272b9e7
    Patrick Steinhardt authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The URL matching function computes for two URLs whether they match not.
    The match is performed by splitting up the URL into different parts and
    then doing an exact comparison with the to-be-matched URL.
    
    The main user of `urlmatch` is the configuration subsystem. It allows to
    set certain configurations based on the URL which is being connected to
    via keys like `http.<url>.*`. A common use case for this is to set
    proxies for only some remotes which match the given URL. Unfortunately,
    having exact matches for all parts of the URL can become quite tedious
    in some setups. Imagine for example a corporate network where there are
    dozens or even hundreds of subdomains, which would have to be configured
    individually.
    
    Allow users to write an asterisk '*' in place of any 'host' or
    'subdomain' label as part of the host name.  For example,
    "http.https://*.example.com.proxy" sets "http.proxy" for all direct
    subdomains of "https://example.com", e.g. "https://foo.example.com", but
    not "https://foo.bar.example.com".
    
    Signed-off-by: default avatarPatrick Steinhardt <patrick.steinhardt@elego.de>
    Helped-by: default avatarJunio C Hamano <gitster@pobox.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    a272b9e7