@@ -132,6 +132,19 @@ static int warnif_rule_after_http_req(struct proxy *proxy, const char *file, int
132132 return 0 ;
133133}
134134
135+ /* Report a warning if a rule is placed after an 'http_response' rule.
136+ * Return 1 if the warning has been emitted, otherwise 0.
137+ */
138+ static int warnif_rule_after_http_res (struct proxy * proxy , const char * file , int line , const char * arg1 , const char * arg2 )
139+ {
140+ if (!LIST_ISEMPTY (& proxy -> http_res_rules )) {
141+ ha_warning ("parsing [%s:%d] : a '%s%s%s' rule placed after an 'http-response' rule will still be processed before.\n" ,
142+ file , line , arg1 , (arg2 ? " " : "" ), (arg2 ? arg2 : "" ));
143+ return 1 ;
144+ }
145+ return 0 ;
146+ }
147+
135148/* Report a warning if a rule is placed after a redirect rule.
136149 * Return 1 if the warning has been emitted, otherwise 0.
137150 */
@@ -199,6 +212,12 @@ int warnif_misplaced_tcp_req_cont(struct proxy *proxy, const char *file, int lin
199212 warnif_misplaced_monitor (proxy , file , line , arg1 , arg2 );
200213}
201214
215+ /* report a warning if a "tcp response content" rule is dangerously placed */
216+ int warnif_misplaced_tcp_res_cont (struct proxy * proxy , const char * file , int line , const char * arg1 , const char * arg2 )
217+ {
218+ return warnif_rule_after_http_res (proxy , file , line , arg1 , arg2 );
219+ }
220+
202221/* report a warning if a "tcp request session" rule is dangerously placed */
203222int warnif_misplaced_tcp_req_sess (struct proxy * proxy , const char * file , int line , const char * arg1 , const char * arg2 )
204223{
0 commit comments