]> err.no Git - varnish/commitdiff
Always send X-Forwarded-for: header to backend.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 23 Sep 2006 19:30:29 +0000 (19:30 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 23 Sep 2006 19:30:29 +0000 (19:30 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1121 d4fa192b-c00b-0410-8231-f00ffab90ce4

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

index d1889455cd9e8cb49153909beb4ec65c6d673f1c..1a96b31abc90d0dc2a8230b401bc5c14f178f257 100644 (file)
@@ -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);
index 86ec8d635d038d9eb57b79918a5b3880b3b3f22c..d78c76818faf0a6cdbf3ce2c29f70ba72b165f11 100644 (file)
@@ -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");
index c2cf1116a76249556b892e10a2b344eed5334c2e..877c9171fe17abf94f6967dd7a450b1639ef1e96 100644 (file)
@@ -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);