@@ -1336,7 +1336,7 @@ void http_replace(const struct tfe_stream * stream, const struct tfe_http_sessio
|
||||
if (tfe_http_in_request(events))
|
||||
{
|
||||
rewrite_uri_sz = execute_replace_rule(in_req_spec->uri, strlen(in_req_spec->uri),
|
||||
kZoneRequestUri, rep_ctx->rule, rep_ctx->n_rule, &rewrite_uri);
|
||||
kZoneRequestUri, rep_ctx->rule, rep_ctx->n_rule, &rewrite_uri, 1);
|
||||
if(rewrite_uri_sz>0) rep_ctx->actually_replaced=1;
|
||||
rep_ctx->replacing = tfe_http_session_request_create(to_write_sess, in_req_spec->method,
|
||||
rewrite_uri_sz >0 ? rewrite_uri : in_req_spec->uri);
|
||||
@@ -1371,7 +1371,7 @@ void http_replace(const struct tfe_stream * stream, const struct tfe_http_sessio
|
||||
rewrite_buff = NULL;
|
||||
rewrite_sz = 0;
|
||||
rewrite_sz=execute_replace_rule(in_header_value,
|
||||
strlen(in_header_value), zone, rep_ctx->rule, rep_ctx->n_rule, &rewrite_buff);
|
||||
strlen(in_header_value), zone, rep_ctx->rule, rep_ctx->n_rule, &rewrite_buff, 1);
|
||||
|
||||
if(rewrite_sz>0) rep_ctx->actually_replaced=1;
|
||||
tfe_http_field_write(rep_ctx->replacing, &in_header_field, rewrite_sz>0? rewrite_buff : in_header_value);
|
||||
@@ -1395,6 +1395,7 @@ void http_replace(const struct tfe_stream * stream, const struct tfe_http_sessio
|
||||
|
||||
if ((events & EV_HTTP_REQ_BODY_END) || (events & EV_HTTP_RESP_BODY_END))
|
||||
{
|
||||
int options = 0;
|
||||
char * __http_body = (char *) evbuffer_pullup(rep_ctx->http_body, -1);
|
||||
size_t __http_body_len = evbuffer_get_length(rep_ctx->http_body);
|
||||
|
||||
@@ -1403,8 +1404,13 @@ void http_replace(const struct tfe_stream * stream, const struct tfe_http_sessio
|
||||
rewrite_buff = NULL;
|
||||
rewrite_sz = 0;
|
||||
|
||||
if (in_resp_spec->content_type != NULL && strstr(in_resp_spec->content_type, "charset=utf-8"))
|
||||
{
|
||||
options = 1;
|
||||
}
|
||||
|
||||
rewrite_sz = execute_replace_rule(__http_body, __http_body_len, r_zone,
|
||||
rep_ctx->rule, rep_ctx->n_rule, &rewrite_buff);
|
||||
rep_ctx->rule, rep_ctx->n_rule, &rewrite_buff, options);
|
||||
|
||||
if (rewrite_sz >0 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user