what if a header I'm testing is missing?

Ricardo Newbery ric at digitalmarbles.com
Fri Mar 21 11:36:34 CET 2008


This is a minor thing but I'm wondering if I'm making an incorrect  
assumption.

In my vcl file, I have lines similar to the following...

     if (req.http.Cookie && req.http.Cookie ~ "(__ac=|_ZopeId=)") {
         pass;
     }

and I'm wondering if the first part of this is unnecessary.  For  
example, what happens if I have this...


     if (req.http.Cookie ~ "(__ac=|_ZopeId=)") {
         pass;
     }

but no Cookie header is present in the request.  Is Varnish flexible  
enough to realize that the test fails without throwing an error?

Ric







More information about the varnish-misc mailing list