r1956 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Thu Sep 20 08:26:17 CEST 2007
Author: phk
Date: 2007-09-20 08:26:17 +0200 (Thu, 20 Sep 2007)
New Revision: 1956
Modified:
trunk/varnish-cache/bin/varnishd/cache_ban.c
trunk/varnish-cache/bin/varnishd/cache_vrt_re.c
Log:
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.
Modified: trunk/varnish-cache/bin/varnishd/cache_ban.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_ban.c 2007-09-18 11:40:44 UTC (rev 1955)
+++ trunk/varnish-cache/bin/varnishd/cache_ban.c 2007-09-20 06:26:17 UTC (rev 1956)
@@ -62,7 +62,7 @@
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];
Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_re.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt_re.c 2007-09-18 11:40:44 UTC (rev 1955)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt_re.c 2007-09-20 06:26:17 UTC (rev 1956)
@@ -53,7 +53,7 @@
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;
}
More information about the varnish-commit
mailing list