MEDIUM: filters: Replace filter_http_headers callback by an analyzer
This new analyzer will be called for each HTTP request/response, before the
parsing of the body. It is identified by AN_FLT_HTTP_HDRS.
Special care was taken about the following condition :
* the frontend is a TCP proxy
* filters are defined in the frontend section
* the selected backend is a HTTP proxy
So, this patch explicitly add AN_FLT_HTTP_HDRS analyzer on the request and the
response channels when the backend is a HTTP proxy and when there are filters
attatched on the stream.
This patch simplifies http_request_forward_body and http_response_forward_body
functions.
diff --git a/src/cfgparse.c b/src/cfgparse.c
index d343f05..55622a4 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -8438,6 +8438,10 @@
if (!LIST_ISEMPTY(&curproxy->filters)) {
curproxy->fe_req_ana |= AN_FLT_ALL_FE;
curproxy->fe_rsp_ana |= AN_FLT_ALL_FE;
+ if (curproxy->mode == PR_MODE_HTTP) {
+ curproxy->fe_req_ana |= AN_FLT_HTTP_HDRS;
+ curproxy->fe_rsp_ana |= AN_FLT_HTTP_HDRS;
+ }
}
}
@@ -8464,6 +8468,10 @@
if (!LIST_ISEMPTY(&curproxy->filters)) {
curproxy->be_req_ana |= AN_FLT_ALL_BE;
curproxy->be_rsp_ana |= AN_FLT_ALL_BE;
+ if (curproxy->mode == PR_MODE_HTTP) {
+ curproxy->be_req_ana |= AN_FLT_HTTP_HDRS;
+ curproxy->be_rsp_ana |= AN_FLT_HTTP_HDRS;
+ }
}
}
}