From: Christopher Faulet Date: Wed, 8 Feb 2017 11:41:31 +0000 (+0100) Subject: BUG/MINOR: http: Return an error when a replace-header rule failed on the response X-Git-Tag: v1.8-dev1~139 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cdade94cf52886167979195af64b403360539db4;p=thirdparty%2Fhaproxy.git BUG/MINOR: http: Return an error when a replace-header rule failed on the response Historically, http-response rules couldn't produce errors generating HTTP responses during their evaluation. This possibility was "implicitly" added with http-response redirect rules (51d861a4). But, at the time, replace-header rules were kept untouched. When such a rule failed, the rules processing was just stopped (like for an accept rule). Conversely, when a replace-header rule fails on the request, it generates a HTTP response (400 Bad Request). With this patch, errors on replace-header rule are now handled in the same way for HTTP requests and HTTP responses. This patch should be backported in 1.7 and 1.6. --- diff --git a/src/proto_http.c b/src/proto_http.c index 3d8005e627..5ad295676a 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -3823,7 +3823,7 @@ resume_execution: rule->arg.hdr_add.name_len, &rule->arg.hdr_add.fmt, &rule->arg.hdr_add.re, rule->action)) - return HTTP_RULE_RES_STOP; /* note: we should report an error here */ + return HTTP_RULE_RES_BADREQ; break; case ACT_HTTP_DEL_HDR: