r778 - in trunk/varnish-cache: bin/varnishd include lib/libvcl

Poul-Henning Kamp phk at phk.freebsd.dk
Wed Aug 9 13:45:11 CEST 2006


In message <ujrirl25efu.fsf at cat.linpro.no>, Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= writes:

>>         if (req.http.host ~ "^(www\\.)?vg\\.no$") {

I think we should drop \ substitution in VCL strings in toto.
Instead we could allow HTTP like %xx so that people can get " into
a string.

Comments ?

>Note that this only works if the client provides a valid Host: header.
>What I want to do in the long run is:
>
> - define HTTP_HDR_HOST and the corresponding req.host variable to be
>   used instead of req.http.host.

Uhm, please don't.  HOST is not a field in the HTTP protocol, it is
a header and should be treated as such.

> - add code to cache_http.c to dissect and normalize the request URL,
>   and set the initial value of req.host based on the host part of the
>   request URL and / or the Host: header

I have yet to see a single requst which included the host in the URI.

> - make req.host and req.url writable so vcl_recv can perform further
>   normalization if needed (e.g. rewrite vg.no to www.vg.no)

yes.


-- 
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