From: phk Date: Thu, 20 Sep 2007 06:26:17 +0000 (+0000) Subject: Make regular expressions case insensitive. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a676fca6210c51bf4977abc28505c540dbf2895d;p=varnish Make regular expressions case insensitive. This is not optimal, but a better compromise than the alternative. DNS names are case insensitive, but URLs are not. However, URLs are very often filenames and having files which differ only in case is already asking for trouble. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1956 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_ban.c b/varnish-cache/bin/varnishd/cache_ban.c index d29ced3f..7577aaf4 100644 --- a/varnish-cache/bin/varnishd/cache_ban.c +++ b/varnish-cache/bin/varnishd/cache_ban.c @@ -62,7 +62,7 @@ AddBan(const char *regexp, int hash) b = calloc(sizeof *b, 1); XXXAN(b); - i = regcomp(&b->regexp, regexp, REG_EXTENDED | REG_NOSUB); + i = regcomp(&b->regexp, regexp, REG_EXTENDED | REG_ICASE | REG_NOSUB); if (i) { char buf[512]; diff --git a/varnish-cache/bin/varnishd/cache_vrt_re.c b/varnish-cache/bin/varnishd/cache_vrt_re.c index 24982b72..221a33db 100644 --- a/varnish-cache/bin/varnishd/cache_vrt_re.c +++ b/varnish-cache/bin/varnishd/cache_vrt_re.c @@ -53,7 +53,7 @@ VRT_re_init(void **rep, const char *re, int sub) t = calloc(sizeof *t, 1); XXXAN(t); /* This was already check-compiled by the VCL compiler */ - AZ(regcomp(t, re, REG_EXTENDED | (sub ? 0 : REG_NOSUB))); + AZ(regcomp(t, re, REG_EXTENDED | REG_ICASE | (sub ? 0 : REG_NOSUB))); *rep = t; }