From 4ec9ab0d3484367ce8c963c4a2b3fd30ba165551 Mon Sep 17 00:00:00 2001
From: Sagi Bashari <sagi@myheritage.com>
Date: Sat, 8 Oct 2011 22:48:48 +0200
Subject: [PATCH] Fixing options forwardfor if-none when an alternative header
 name is specified

---
 src/proto_http.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/proto_http.c b/src/proto_http.c
index 3ae46bc..fd298b7 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -3544,7 +3544,7 @@ int http_process_request(struct session *s, struct buffer *req, int an_bit)
 		struct hdr_ctx ctx = { .idx = 0 };
 
 		if (!((s->fe->options | s->be->options) & PR_O_FF_ALWAYS) &&
-		    http_find_header2("X-Forwarded-For", 15, txn->req.sol, &txn->hdr_idx, &ctx)) {
+		    http_find_header2(s->be->fwdfor_hdr_name, s->be->fwdfor_hdr_len, txn->req.sol, &txn->hdr_idx, &ctx)) {
 			/* The header is set to be added only if none is present
 			 * and we found it, so don't do anything.
 			 */
-- 
1.7.5.1

