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

[PATCH v1 0/2] urlmatch: allow regexp-based matches

From
Patrick Steinhardt <patrick.steinhardt@elego.de>
Date
Jan 23, 2017, 13:06 UTC
Message-ID
<20170123130635.29577-1-patrick.steinhardt@elego.de>
Hi,

Short disclaimer: this patch results from work for a client at my day job at elego Software Solutions GmbH. As such, I'm using my work mail address and added a new mailmap entry. I wasn't exactly certain if the mailmap entry should've been created in a separate commit series, as it has nothing to do with the actual topic -- I can re-send it separately if requested.

This patch is mostly a request for comments. The use case is to be able to configure an HTTP proxy for all subdomains of a certain domain where there are hundreds of subdomains. The most flexible way I could imagine was by using regular expressions for the matching, which is how I implemented it for now. So users can now create a configuration key like `http.?http://.*\\.example\\.com.*` to apply settings for all subdomains of `example.com`.

I tried to make this feature as backwards-compatible as it can be by having the '?' prefix. Older clients will barf when trying to normalize the URL as '?' is not in the set of allowed characters for a URL, and for newer clients there will be no change in behavior for previously configured `http.<url>.*` keys.

Regards Patrick Steinhardt

Patrick Steinhardt (2):
  mailmap: add Patrick Steinhardt's work address
  urlmatch: allow regex-based URL matching
 .mailmap                 |  1 +
 Documentation/config.txt |  6 ++++-
 t/t1300-repo-config.sh   | 31 ++++++++++++++++++++++++++
 urlmatch.c               | 57 ++++++++++++++++++++++++++++++++++++++----------
 4 files changed, 82 insertions(+), 13 deletions(-)
-- 
2.11.0
Next: Patrick Steinhardt
Message 1 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.