Commit 95dca54f authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

r31752@cat (orig r1121): phk | 2006-09-23 21:30:29 +0200

 Always send X-Forwarded-for: header to backend.
 
 


git-svn-id: http://www.varnish-cache.org/svn/branches/1.0@1160 d4fa192b-c00b-0410-8231-f00ffab90ce4
parents 895d0548 61337d92
......@@ -341,6 +341,8 @@ FetchHeaders(struct sess *sp)
http_GetReq(w, vc->fd, vc->http, sp->http);
http_FilterHeader(w, vc->fd, vc->http, sp->http, HTTPH_R_FETCH);
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);
......
......@@ -187,6 +187,8 @@ PassBody(struct sess *sp)
http_CopyResp(sp->wrk, sp->fd, sp->http, vc->http);
http_FilterHeader(sp->wrk, sp->fd, sp->http, vc->http, HTTPH_A_PASS);
http_PrintfHeader(sp->wrk, sp->fd, sp->http, "X-Varnish: %u", sp->xid);
http_PrintfHeader(sp->wrk, sp->fd, sp->http,
"X-Forwarded-for: %s", sp->addr);
/* XXX */
if (http_HdrIs(vc->http, H_Transfer_Encoding, "chunked"))
http_PrintfHeader(sp->wrk, sp->fd, sp->http, "Transfer-Encoding: chunked");
......
......@@ -88,6 +88,8 @@ PipeSession(struct sess *sp)
http_CopyReq(w, vc->fd, vc->http, sp->http);
http_FilterHeader(w, vc->fd, vc->http, sp->http, HTTPH_R_PIPE);
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);
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