diff options
author | Patrick Steinhardt <patrick.steinhardt@elego.de> | 2017-01-31 10:01:47 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-01 13:22:50 -0800 |
commit | a272b9e70a48a355b6dd7ff0179c11f8da7ef0f3 (patch) | |
tree | 969e517781e74bbecbcb04e2b138fb68fbc150ce /Documentation | |
parent | urlmatch: include host in urlmatch ranking (diff) | |
download | tgif-a272b9e70a48a355b6dd7ff0179c11f8da7ef0f3.tar.xz |
urlmatch: allow globbing for the URL host part
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: Patrick Steinhardt <patrick.steinhardt@elego.de>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/config.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index af2ae4cc02..ee155d8a6b 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1914,7 +1914,10 @@ http.<url>.*:: must match exactly between the config key and the URL. . Host/domain name (e.g., `example.com` in `https://example.com/`). - This field must match exactly between the config key and the URL. + This field must match between the config key and the URL. It is + possible to specify a `*` as part of the host name to match all subdomains + at this level. `https://*.example.com/` for example would match + `https://foo.example.com/`, but not `https://foo.bar.example.com/`. . Port number (e.g., `8080` in `http://example.com:8080/`). This field must match exactly between the config key and the URL. |