Commit 9d8a9e19 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

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



git-svn-id: http://www.varnish-cache.org/svn/trunk@1121 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent f058ac9e
......@@ -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