[PATCH] Normalizing the Host: header

Poul-Henning Kamp phk at phk.freebsd.dk
Thu Feb 17 18:32:47 CET 2011

In message <4D5D1AC9.3000507 at uplex.de>, Nils Goroll writes:

>we were discussion this on VUG3: comparisons on the Host: header should be case
>insensitive. Reflecting on this, I think that normalizing the Host: header in
>Varnish would actually be the better idea and should avoid common errors.

What a great idea for a VMOD :-)

But this is exactly the kind of needless text-processing we should avoid
if we want to be the fastest cache on the planet:  a regexp or a strncasecmp()
is not measurably slower than their case-sensitive parallels and if you
don't need to inspect the host-header at all, case-folding it is pure
wasted effort.

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-dev mailing list