obj.status in synthetic responses

Michael Alger varnish at mm.quex.org
Fri Sep 3 12:44:56 CEST 2010


I've noticed that in a setup that does something along the lines of:

  sub vcl_recv {
   ...
   if (something) {
     error 798;
   }
  }

  sub vcl_error {
    if (obj.status == 798) {
      set obj.status = 404;
      synthetic {"Oh no, a "} obj.status {" occurred!"};
    }
  }

The actual HTTP response code will be correct (404), but the text
returned in the response will say the status was 798.

This is pretty minor since the important bit (the HTTP response) uses
the updated value of obj.status, but I thought it was curious the
synthetic response text used the old value.




More information about the varnish-misc mailing list