Commit 4a799d12 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Also add missing Host: headers for Pass & Pipe


git-svn-id: http://www.varnish-cache.org/svn/trunk@1134 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 47561873
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment