#define HTTP_MSGF_XFER_LEN 0x00000004 /* message xfer size can be determined */
#define HTTP_MSGF_VER_11 0x00000008 /* the message is HTTP/1.1 or above */
-/* unused: 0x00000010 */
+#define HTTP_MSGF_SOFT_RW 0x00000010 /* soft header rewrites, no error triggered */
#define HTTP_MSGF_COMPRESSING 0x00000020 /* data compression is in progress */
_HA_ATOMIC_ADD(&s->be->be_counters.failed_rewrites, 1);
if (sess->listener->counters)
_HA_ATOMIC_ADD(&sess->listener->counters->failed_rewrites, 1);
+
+ if (!(txn->req.flags & HTTP_MSGF_SOFT_RW)) {
+ rule_ret = HTTP_RULE_RES_ERROR;
+ goto end;
+ }
}
free_trash_chunk(replace);
break;
_HA_ATOMIC_ADD(&sess->listener->counters->failed_rewrites, 1);
if (objt_server(s->target))
_HA_ATOMIC_ADD(&__objt_server(s->target)->counters.failed_rewrites, 1);
+
+ if (!(txn->rsp.flags & HTTP_MSGF_SOFT_RW)) {
+ rule_ret = HTTP_RULE_RES_ERROR;
+ goto end;
+ }
}
free_trash_chunk(replace);
break;
void http_txn_reset_req(struct http_txn *txn)
{
- txn->req.flags = 0;
+ txn->req.flags = HTTP_MSGF_SOFT_RW;
txn->req.msg_state = HTTP_MSG_RQBEFORE; /* at the very beginning of the request */
}
void http_txn_reset_res(struct http_txn *txn)
{
- txn->rsp.flags = 0;
+ txn->rsp.flags = HTTP_MSGF_SOFT_RW;
txn->rsp.msg_state = HTTP_MSG_RPBEFORE; /* at the very beginning of the response */
}