From a676fca6210c51bf4977abc28505c540dbf2895d Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 20 Sep 2007 06:26:17 +0000 Subject: [PATCH] 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 --- varnish-cache/bin/varnishd/cache_ban.c | 2 +- varnish-cache/bin/varnishd/cache_vrt_re.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.39.5