git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/4] urlmatch: allow regexp-based matches

From
Patrick Steinhardt <patrick.steinhardt@elego.de>
Date
Jan 24, 2017, 17:00 UTC
Message-ID
<20170124170031.18069-1-patrick.steinhardt@elego.de>
In-Reply-To
<20170123130635.29577-1-patrick.steinhardt@elego.de>
Hi,
This is version two of my patch series.

The use case is to be able to configure an HTTP proxy for all subdomains of a domain where there are hundreds of subdomains.

Previously, I have been using complete regular expressions with an escape-mechanism to match the configuration key's URLs. According to Junio's comments, I changed this mechanism to a much simpler one, where the user is only allowed to use globbing for the host part of the URL. That is a user can now specify a key `http.https://*.example.com` to match all sub-domains of `example.com`. For now I've decided to implement it such that a single `*` matches a single subdomain only, so for example `https://foo.bar.example.com` would not match in this case. This is similar to how shell-globbing works usually, so it should not be of much surprise. It's also highlighted in the documentation.

I did not include an interdiff as too much has changed between the two versions.

Regards Patrick

Patrick Steinhardt (4):
  mailmap: add Patrick Steinhardt's work address
  urlmatch: enable normalization of URLs with globs
  urlmatch: split host and port fields in `struct url_info`
  urlmatch: allow globbing for the URL host part
 .mailmap                 |  1 +
 Documentation/config.txt |  5 +++-
 t/t1300-repo-config.sh   | 36 +++++++++++++++++++++++++
 urlmatch.c               | 68 +++++++++++++++++++++++++++++++++++++++++-------
 urlmatch.h               |  9 ++++---
 5 files changed, 104 insertions(+), 15 deletions(-)
-- 
2.11.0
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 6 of 12 in “urlmatch: allow regexp-based matches”
  1. 0/2 urlmatch: allow regexp-based matchesPatrick Steinhardt, Jan 23, 2017
  2. 2/2 urlmatch: allow regex-based URL matchingPatrick Steinhardt, Jan 23, 2017
  3. 1/2 mailmap: add Patrick Steinhardt's work addressPatrick Steinhardt, Jan 23, 2017
  4. Junio C HamanoJan 23, 2017
  5. Patrick SteinhardtJan 24, 2017
  6. 0/4 urlmatch: allow regexp-based matchesPatrick Steinhardt, Jan 24, 2017
  7. 1/4 mailmap: add Patrick Steinhardt's work addressPatrick Steinhardt, Jan 24, 2017
  8. 2/4 urlmatch: enable normalization of URLs with globsPatrick Steinhardt, Jan 24, 2017
  9. 3/4 urlmatch: split host and port fields in `struct url_info`Patrick Steinhardt, Jan 24, 2017
  10. 4/4 urlmatch: allow globbing for the URL host partPatrick Steinhardt, Jan 24, 2017
  11. Philip OakleyJan 24, 2017
  12. Patrick SteinhardtJan 25, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.