Merge branch 'jk/loosen-urlmatch'

Treat "_" as any other URL-valid characters in an URL when matching
the per-URL configuration variable names.

* jk/loosen-urlmatch:
  urlmatch: add underscore to URL_HOST_CHARS
This commit is contained in:
Junio C Hamano 2021-11-29 15:41:44 -08:00
commit 96eca029bf
2 changed files with 2 additions and 2 deletions

View file

@ -47,7 +47,7 @@ test_expect_success 'url authority' '
test-tool urlmatch-normalization "scheme://@host" &&
test-tool urlmatch-normalization "scheme://%00@host" &&
! test-tool urlmatch-normalization "scheme://%%@host" &&
! test-tool urlmatch-normalization "scheme://host_" &&
test-tool urlmatch-normalization "scheme://host_" &&
test-tool urlmatch-normalization "scheme://user:pass@host/" &&
test-tool urlmatch-normalization "scheme://@host/" &&
test-tool urlmatch-normalization "scheme://host/" &&

View file

@ -5,7 +5,7 @@
#define URL_DIGIT "0123456789"
#define URL_ALPHADIGIT URL_ALPHA URL_DIGIT
#define URL_SCHEME_CHARS URL_ALPHADIGIT "+.-"
#define URL_HOST_CHARS URL_ALPHADIGIT ".-[:]" /* IPv6 literals need [:] */
#define URL_HOST_CHARS URL_ALPHADIGIT ".-_[:]" /* IPv6 literals need [:] */
#define URL_UNSAFE_CHARS " <>\"%{}|\\^`" /* plus 0x00-0x1F,0x7F-0xFF */
#define URL_GEN_RESERVED ":/?#[]@"
#define URL_SUB_RESERVED "!$&'()*+,;="