Hi,

I start to evaluate the new add-header/set-header option, I encountered issues.
I use nginx as web server behind HAProxy, and nginx reply 400 bad
request at every request.

The header set with add-header/set-header is malformed, I have a null
character before the end of the
line, for exemple :

http-request set-header X-SSL-TOTO %[ssl_fc]

set the following header : X-SSL-TOTO: 1\000\r\n

The length of header value seem too big, the following workaround fix
this issue (not optimal I now):

diff --git a/src/proto_http.c b/src/proto_http.c
index 535c159..eb10213 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -3112,7 +3112,7 @@ http_check_access_rule(struct proxy *px, struct
list *rules, struct session *s,
                                trash.str[trash.len++] = ':';
                                trash.str[trash.len++] = ' ';
                                trash.len += build_logline(s, trash.str + 
trash.len, trash.size -
trash.len, &rule->arg.hdr_add.fmt);
-                               http_header_add_tail2(&txn->req, &txn->hdr_idx, 
trash.str, trash.len);
+                               http_header_add_tail2(&txn->req, &txn->hdr_idx, 
trash.str, trash.len-1);
                                break;
                        }
                }

-- 
David BERARD
contact(at)davidberard.fr
* No electrons were harmed in the transmission of this email *

Reply via email to