]> err.no Git - varnish/commitdiff
Also add missing Host: headers for Pass & Pipe
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 2 Oct 2006 14:08:49 +0000 (14:08 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 2 Oct 2006 14:08:49 +0000 (14:08 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1134 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_pass.c
varnish-cache/bin/varnishd/cache_pipe.c

index d78c76818faf0a6cdbf3ce2c29f70ba72b165f11..694e6fa25fa2521916a106f5b581a01b917ceaf1 100644 (file)
@@ -226,6 +226,7 @@ PassSession(struct sess *sp)
        int i;
        struct vbe_conn *vc;
        struct worker *w;
+       char *b;
 
        CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
        CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC);
@@ -238,6 +239,10 @@ PassSession(struct sess *sp)
        http_CopyReq(w, vc->fd, vc->http, sp->http);
        http_FilterHeader(w, vc->fd, vc->http, sp->http, HTTPH_R_PASS);
        http_PrintfHeader(w, vc->fd, vc->http, "X-Varnish: %u", sp->xid);
+       if (!http_GetHdr(vc->http, H_Host, &b)) {
+               http_PrintfHeader(w, vc->fd, vc->http, "Host: %s",
+                   sp->backend->hostname);
+       }
        WRK_Reset(w, &vc->fd);
        http_Write(w, vc->http, 0);
        i = WRK_Flush(w);
index 496505449d1f64d998b2b6d2f642e89d44297d38..5bf99156eaed38499ec5afd119b566e66398c75b 100644 (file)
@@ -90,6 +90,10 @@ PipeSession(struct sess *sp)
        http_PrintfHeader(w, vc->fd, vc->http, "X-Varnish: %u", sp->xid);
        http_PrintfHeader(w, vc->fd, vc->http,
            "X-Forwarded-for: %s", sp->addr);
+       if (!http_GetHdr(vc->http, H_Host, &b)) {
+               http_PrintfHeader(w, vc->fd, vc->http, "Host: %s",
+                   sp->backend->hostname);
+       }
        WRK_Reset(w, &vc->fd);
        http_Write(w, vc->http, 0);